From ee1950c7d0daecf44df07c149a1702289b00dba4 Mon Sep 17 00:00:00 2001 From: Aki Tuomi Date: Mon, 4 Dec 2017 11:01:05 +0200 Subject: [PATCH] imap: Include mail user variables in logout format --- src/imap/imap-client.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index 76124b36fd..e8b2816064 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -237,7 +237,7 @@ void client_command_cancel(struct client_command_context **_cmd) const char *client_stats(struct client *client) { - const struct var_expand_table tab[] = { + const struct var_expand_table logout_tab[] = { { 'i', dec2str(i_stream_get_absolute_offset(client->input)), "input" }, { 'o', dec2str(client->output->offset), "output" }, { '\0', client->session_id, "session" }, @@ -252,11 +252,17 @@ const char *client_stats(struct client *client) { '\0', dec2str(client->append_count), "appended" }, { '\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->imap_logout_format, tab, &error) <= 0) { + if (var_expand_with_funcs(str, client->set->imap_logout_format, + tab, mail_user_var_expand_func_table, + client->user, &error) < 0) { i_error("Failed to expand imap_logout_format=%s: %s", client->set->imap_logout_format, error); }