]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap-client: Add %{autoexpunged} to imap_logout_format
authorMartti Rannanjärvi <martti.rannanjarvi@dovecot.fi>
Mon, 3 Jul 2017 14:12:08 +0000 (17:12 +0300)
committerTimo Sirainen <tss@dovecot.fi>
Wed, 19 Jul 2017 14:03:45 +0000 (17:03 +0300)
doc/example-config/conf.d/20-imap.conf
src/imap/imap-client.c
src/imap/imap-client.h

index 29f72246654e0d6ce88e1bc2eaaa421a7b2f6094..95d51d62c3bfcfb48c85b2db843a8fa801fdac70 100644 (file)
 #  %{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} \
index e4356e18641ca8119fb8db145b61a5837a266f4d..35f7fe86f5882a4cf72c36530571c1e4a3934661 100644 (file)
@@ -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);
index e085ac613e9da076797d57b6870703a680767309..91683cffcf24bc398b179efc788244d9fb89eacb 100644 (file)
@@ -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;