From: Aki Tuomi Date: Fri, 10 Mar 2017 08:05:14 +0000 (+0200) Subject: pop3-login: Add FORWARD for XCLIENT X-Git-Tag: 2.2.29.rc1~133 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2c182e046b5972197c62fe6c03e333b4758d310b;p=thirdparty%2Fdovecot%2Fcore.git pop3-login: Add FORWARD for XCLIENT This allows passing passdb variables. They are prefixed with forward_ when imported to extra fields. --- diff --git a/src/pop3-login/client.c b/src/pop3-login/client.c index a1514e8731..41efd2fe93 100644 --- a/src/pop3-login/client.c +++ b/src/pop3-login/client.c @@ -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) {