]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3-login: Add FORWARD for XCLIENT
authorAki Tuomi <aki.tuomi@dovecot.fi>
Fri, 10 Mar 2017 08:05:14 +0000 (10:05 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 21 Mar 2017 09:53:17 +0000 (11:53 +0200)
This allows passing passdb variables. They are prefixed
with forward_ when imported to extra fields.

src/pop3-login/client.c

index a1514e8731dfbb72a2cf118d4cfcdb95d187af8e..41efd2fe934b4f9a85934dbd6e763982eb22e29e 100644 (file)
@@ -65,6 +65,14 @@ static bool cmd_xclient(struct pop3_client *client, const char *args)
                } else if (strncasecmp(*tmp, "TTL=", 4) == 0) {
                        if (str_to_uint(*tmp + 4, &client->common.proxy_ttl) < 0)
                                args_ok = FALSE;
+               } else if (strncasecmp(*tmp, "FORWARD=", 8) == 0) {
+                       size_t value_len = strlen((*tmp)+8);
+                       client->common.forward_fields =
+                               str_new(client->common.preproxy_pool,
+                                       MAX_BASE64_DECODED_SIZE(value_len));
+                       if (base64_decode((*tmp)+8, value_len, NULL,
+                                         client->common.forward_fields) < 0)
+                               args_ok = FALSE;
                }
        }
        if (!args_ok) {