From: Martti Rannanjärvi Date: Tue, 11 Jul 2017 10:12:46 +0000 (+0300) Subject: imap: Add %{appended} to imap_logout_format X-Git-Tag: 2.2.32.rc1~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=39e7abd34cce7644fd0c7f7750315c4ac9637b88;p=thirdparty%2Fdovecot%2Fcore.git imap: Add %{appended} to imap_logout_format --- diff --git a/doc/example-config/conf.d/20-imap.conf b/doc/example-config/conf.d/20-imap.conf index bc51ac300d..8bedfe18e8 100644 --- a/doc/example-config/conf.d/20-imap.conf +++ b/doc/example-config/conf.d/20-imap.conf @@ -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 '+', diff --git a/src/imap/cmd-append.c b/src/imap/cmd-append.c index aae5fa3cbc..02db96b7dc 100644 --- a/src/imap/cmd-append.c +++ b/src/imap/cmd-append.c @@ -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) { diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index 9b28a6a952..163426039c 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -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); diff --git a/src/imap/imap-client.h b/src/imap/imap-client.h index a385934bd2..75700de639 100644 --- a/src/imap/imap-client.h +++ b/src/imap/imap-client.h @@ -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;