From: Martti Rannanjärvi Date: Mon, 3 Jul 2017 14:12:08 +0000 (+0300) Subject: imap-client: Add %{autoexpunged} to imap_logout_format X-Git-Tag: 2.3.0.rc1~1239 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0aa23d8824f31a55928d4631e0e702925d534f6e;p=thirdparty%2Fdovecot%2Fcore.git imap-client: Add %{autoexpunged} 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 29f7224665..95d51d62c3 100644 --- a/doc/example-config/conf.d/20-imap.conf +++ b/doc/example-config/conf.d/20-imap.conf @@ -21,7 +21,10 @@ # %{fetch_body_count} - Number of mails with mail body data sent to client # %{fetch_body_bytes} - Number of bytes with mail body data sent to client # %{deleted} - Number of mails where client added \Deleted flag -# %{expunged} - Number of mails that client expunged +# %{expunged} - Number of mails that client expunged, which does not +# include automatically expunged mails +# %{autoexpunged} - Number of mails that were automatically expunged after +# client disconnected # %{trashed} - Number of mails that client copied/moved to the # special_use=\Trash mailbox. #imap_logout_format = in=%i out=%o del=%{deleted} expunged=%{expunged} \ diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index e4356e1864..35f7fe86f5 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -248,6 +248,7 @@ const char *client_stats(struct client *client) { '\0', dec2str(client->deleted_count), "deleted" }, { '\0', dec2str(client->expunged_count), "expunged" }, { '\0', dec2str(client->trashed_count), "trashed" }, + { '\0', dec2str(client->autoexpunged_count), "autoexpunged" }, { '\0', NULL, NULL } }; string_t *str; @@ -452,7 +453,7 @@ static void client_default_destroy(struct client *client, const char *reason) hibernations it could also be doing unnecessarily much work. */ imap_refresh_proctitle(); if (!client->hibernated) { - mail_user_autoexpunge(client->user); + client->autoexpunged_count = mail_user_autoexpunge(client->user); client_log_disconnect(client, reason); } mail_user_unref(&client->user); diff --git a/src/imap/imap-client.h b/src/imap/imap-client.h index e085ac613e..91683cffcf 100644 --- a/src/imap/imap-client.h +++ b/src/imap/imap-client.h @@ -188,6 +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; /* SEARCHRES extension: Last saved SEARCH result */ ARRAY_TYPE(seq_range) search_saved_uidset;