]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3: Include mail user variables in logout format
authorAki Tuomi <aki.tuomi@dovecot.fi>
Mon, 4 Dec 2017 09:01:31 +0000 (11:01 +0200)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 1 Feb 2018 12:50:06 +0000 (14:50 +0200)
src/pop3/pop3-client.c

index 319dd0f8901f8962f401ae369674742ede3a62c3..05998c5184fb5e6e0ae86ebb344340f88cbe7cd0 100644 (file)
@@ -540,22 +540,15 @@ static const char *client_stats(struct client *client)
                { 'd', !client->delete_success ? "0" :
                       dec2str(client->deleted_size), "deleted_bytes" },
        };
-       ARRAY(struct var_expand_table) tab;
        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;
-       size_t n;
-
-       t_array_init(&tab, 32);
-       array_append(&tab, logout_tab, N_ELEMENTS(logout_tab));
-       /* count elements */
-       for(n = 0; user_tab[n].long_key != NULL; n++)
-               ;
-       array_append(&tab, user_tab, n);
-       array_append_zero(&tab);
 
        str = t_str_new(128);
-       var_expand(str, client->set->pop3_logout_format, array_idx(&tab, 0));
+       var_expand_with_funcs(str, client->set->pop3_logout_format, tab,
+                             mail_user_var_expand_func_table, client->user);
        return str_c(str);
 }