From: Timo Sirainen Date: Sun, 20 Jul 2008 17:17:46 +0000 (+0300) Subject: Maildir: If uidlist couldn't be locked while saving, we might have assert-crashed X-Git-Tag: 1.2.alpha1~136 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bac85904dafb164c19b0df5f9115bb35c5cba893;p=thirdparty%2Fdovecot%2Fcore.git Maildir: If uidlist couldn't be locked while saving, we might have assert-crashed afterwards when trying to update cache file for the newly saved message whose index update was already cancelled. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/index-mail.c b/src/lib-storage/index/index-mail.c index 2423eccbf4..318cec206e 100644 --- a/src/lib-storage/index/index-mail.c +++ b/src/lib-storage/index/index-mail.c @@ -1082,7 +1082,12 @@ void index_mail_close(struct mail *_mail) struct index_mail *mail = (struct index_mail *)_mail; struct message_part *parts; - if (mail->mail.mail.seq != 0) { + /* If uid == 0 but seq != 0, we came here from saving a (non-mbox) + message. If that happens, don't bother checking if anything should + be cached since it was already checked. Also by now the transaction + may have already been rollbacked and seq point to a non-existing + message. */ + if (mail->mail.mail.uid != 0) { index_mail_cache_sizes(mail); index_mail_cache_dates(mail); }