]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Enable autoexpunge only when MAIL_STORAGE_SERVICE_FLAG_AUTOEXPUNGE is...
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 20 Jan 2016 11:30:34 +0000 (13:30 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Wed, 20 Jan 2016 11:30:34 +0000 (13:30 +0200)
src/lib-storage/mail-storage-service.c
src/lib-storage/mail-storage-service.h
src/lib-storage/mail-user.c
src/lib-storage/mail-user.h

index 2ca7f27afdf9b0c69b870fc92ce86a5f656dfb9f..c3fdd17097382c857b563ffcdd0c95956887db3c 100644 (file)
@@ -661,6 +661,8 @@ mail_storage_service_init_post(struct mail_storage_service_ctx *ctx,
                p_strdup(mail_user->pool, user->input.session_id);
        mail_user->userdb_fields = user->input.userdb_fields == NULL ? NULL :
                p_strarray_dup(mail_user->pool, user->input.userdb_fields);
+       mail_user->autoexpunge_enabled =
+               (user->flags & MAIL_STORAGE_SERVICE_FLAG_AUTOEXPUNGE) != 0;
        
        mail_set = mail_user_set_get_storage_set(mail_user);
 
index 9424a434c520216cc14059870a2b3e63ca75f3f6..118e8fec1917809a2fb6b98276b768527addc8de 100644 (file)
@@ -33,7 +33,9 @@ enum mail_storage_service_flags {
        /* When executing doveconf, tell it to use sysexits codes */
        MAIL_STORAGE_SERVICE_FLAG_USE_SYSEXITS          = 0x400,
        /* Don't create namespaces, only the user. */
-       MAIL_STORAGE_SERVICE_FLAG_NO_NAMESPACES         = 0x800
+       MAIL_STORAGE_SERVICE_FLAG_NO_NAMESPACES         = 0x800,
+       /* Enable autoexpunging at deinit. */
+       MAIL_STORAGE_SERVICE_FLAG_AUTOEXPUNGE           = 0x1000
 };
 
 struct mail_storage_service_input {
index 628046605559f21a8d62312a787d206d8a86defe..3db82d3104afd7e4eb21c56c3ac492c36b405b37 100644 (file)
@@ -164,7 +164,8 @@ void mail_user_unref(struct mail_user **_user)
                return;
        }
 
-       mail_user_autoexpunge(user);
+       if (user->autoexpunge_enabled)
+               mail_user_autoexpunge(user);
 
        user->deinitializing = TRUE;
 
index df1aef9bc12351d1f995094ace62c9c8c8920d01..68b92f9cc229cbcf8bd2bf9aafb892acddae9110 100644 (file)
@@ -89,6 +89,8 @@ struct mail_user {
        unsigned int admin:1;
        /* Enable all statistics gathering */
        unsigned int stats_enabled:1;
+       /* Enable autoexpunging at deinit. */
+       unsigned int autoexpunge_enabled:1;
 };
 
 struct mail_user_module_register {