From 4a31bc03634dbac397cfc38d8cf11b417fbf2781 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Mon, 4 Dec 2017 11:01:31 +0200 Subject: [PATCH] pop3: Include mail user variables in logout format --- src/pop3/pop3-client.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pop3/pop3-client.c b/src/pop3/pop3-client.c index cf9d0e1784..18ef09113b 100644 --- a/src/pop3/pop3-client.c +++ b/src/pop3/pop3-client.c @@ -524,7 +524,7 @@ static const char *client_stats(struct client *client) 'o', "uidl_change")) uidl_change = client_build_uidl_change_string(client); - const struct var_expand_table tab[] = { + const struct var_expand_table logout_tab[] = { { 'p', dec2str(client->top_bytes), "top_bytes" }, { 't', dec2str(client->top_count), "top_count" }, { 'b', dec2str(client->retr_bytes), "retr_bytes" }, @@ -541,11 +541,17 @@ static const char *client_stats(struct client *client) dec2str(client->deleted_size), "deleted_bytes" }, { '\0', NULL, NULL } }; + const struct var_expand_table *user_tab = + mail_user_var_expand_table(client->user); + const struct var_expand_table *tab = + t_var_expand_merge_tables(logout_tab, user_tab); string_t *str; const char *error; str = t_str_new(128); - if (var_expand(str, client->set->pop3_logout_format, tab, &error) <= 0) { + if (var_expand_with_funcs(str, client->set->pop3_logout_format, + tab, mail_user_var_expand_func_table, + client->user, &error) < 0) { i_error("Failed to expand pop3_logout_format=%s: %s", client->set->pop3_logout_format, error); } -- 2.47.3