Skip to content

Commit

Permalink
pop3-login: Add FORWARD for XCLIENT
Browse files Browse the repository at this point in the history
This allows passing passdb variables. They are prefixed
with forward_ when imported to extra fields.
  • Loading branch information
cmouse authored and sirainen committed Mar 21, 2017
1 parent 870ed05 commit 2c182e0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/pop3-login/client.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 2c182e0

Please sign in to comment.