]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
mdbox: Handle better trying to copy an already purged message.
authorTimo Sirainen <tss@iki.fi>
Mon, 19 Jul 2010 12:06:07 +0000 (13:06 +0100)
committerTimo Sirainen <tss@iki.fi>
Mon, 19 Jul 2010 12:06:07 +0000 (13:06 +0100)
It shouldn't log "refcount update lost map_uid" error.

src/lib-storage/index/dbox-multi/mdbox-map.c

index e82461c334fa4a758d9f1ffb7bd8387908e89a5f..736ff8f87344aa521dbd67ae6177223a41ecaf0c 100644 (file)
@@ -578,8 +578,14 @@ int mdbox_map_update_refcount(struct mdbox_map_transaction_context *ctx,
        if (!mail_index_lookup_seq(map->view, map_uid, &seq)) {
                /* we can't refresh map here since view has a
                   transaction open. */
-               mdbox_map_set_corrupted(map, "refcount update lost map_uid=%u",
-                                       map_uid);
+               if (diff > 0) {
+                       /* the message was probably just purged */
+                       mail_storage_set_error(MAP_STORAGE(map), MAIL_ERROR_EXPUNGED,
+                               "Some of the requested messages no longer exist.");
+               } else {
+                       mdbox_map_set_corrupted(map,
+                               "refcount update lost map_uid=%u", map_uid);
+               }
                return -1;
        }
        mail_index_lookup_ext(map->view, seq, map->ref_ext_id,