From: Timo Sirainen Date: Mon, 19 Jul 2010 12:06:07 +0000 (+0100) Subject: mdbox: Handle better trying to copy an already purged message. X-Git-Tag: 2.0.rc3~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d2d733e1e445b7b4f4e0219a02e2b603084432a0;p=thirdparty%2Fdovecot%2Fcore.git mdbox: Handle better trying to copy an already purged message. It shouldn't log "refcount update lost map_uid" error. --- diff --git a/src/lib-storage/index/dbox-multi/mdbox-map.c b/src/lib-storage/index/dbox-multi/mdbox-map.c index e82461c334..736ff8f873 100644 --- a/src/lib-storage/index/dbox-multi/mdbox-map.c +++ b/src/lib-storage/index/dbox-multi/mdbox-map.c @@ -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,