]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Add %{appended} to imap_logout_format
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Tue, 11 Jul 2017 10:12:46 +0000 (13:12 +0300)
committerAki Tuomi <aki.tuomi@dovecot.fi>
Thu, 20 Jul 2017 10:04:21 +0000 (13:04 +0300)
doc/example-config/conf.d/20-imap.conf
src/imap/cmd-append.c
src/imap/imap-client.c
src/imap/imap-client.h

index bc51ac300d0233d50af35b7a345f6250f25d7693..8bedfe18e8acd147f8008ecb9bb63a1c34e4ab82 100644 (file)
@@ -27,6 +27,7 @@
 #                    client disconnected
 #  %{trashed} - Number of mails that client copied/moved to the
 #               special_use=\Trash mailbox.
+#  %{appended} - Number of mails saved during the session
 #imap_logout_format = in=%i out=%o
 
 # Override the IMAP CAPABILITY response. If the value begins with '+',
index aae5fa3cbc99d503a26139b59380d404c11b0c39..02db96b7dc4968636b528528b3e546088ba6e584 100644 (file)
@@ -665,6 +665,7 @@ static bool cmd_append_finish_parsing(struct client_command_context *cmd)
                imap_write_seq_range(msg, &changes.saved_uids);
                str_append(msg, "] Append completed.");
        }
+       ctx->client->append_count += save_count;
        pool_unref(&changes.pool);
 
        if (ctx->box == cmd->client->mailbox) {
index 9b28a6a95223a4146c54afc9b6d951d2c3c60d01..163426039c55aca4b8700bdead9d7ab63753bed1 100644 (file)
@@ -245,6 +245,7 @@ const char *client_stats(struct client *client)
                { '\0', NULL, "expunged" },
                { '\0', NULL, "trashed" },
                { '\0', NULL, "autoexpunged" },
+               { '\0', NULL, "appended" },
                { '\0', NULL, NULL }
        };
        struct var_expand_table *tab;
@@ -264,6 +265,7 @@ const char *client_stats(struct client *client)
        tab[8].value = dec2str(client->expunged_count);
        tab[9].value = dec2str(client->trashed_count);
        tab[10].value = dec2str(client->autoexpunged_count);
+       tab[11].value = dec2str(client->append_count);
 
        str = t_str_new(128);
        var_expand(str, client->set->imap_logout_format, tab);
index a385934bd284ce8c37787bec57c444cc456c9d1e..75700de639728ab4c8d8b7ee4022d45feab384d1 100644 (file)
@@ -188,7 +188,7 @@ struct client {
        unsigned int fetch_hdr_count, fetch_body_count;
        uint64_t fetch_hdr_bytes, fetch_body_bytes;
        unsigned int deleted_count, expunged_count, trashed_count;
-       unsigned int autoexpunged_count;
+       unsigned int autoexpunged_count, append_count;
 
        /* SEARCHRES extension: Last saved SEARCH result */
        ARRAY_TYPE(seq_range) search_saved_uidset;