]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: dest_mail wasn't reset if previous save was aborted.
authorTimo Sirainen <tss@iki.fi>
Wed, 9 Jan 2013 03:33:32 +0000 (05:33 +0200)
committerTimo Sirainen <tss@iki.fi>
Wed, 9 Jan 2013 03:33:32 +0000 (05:33 +0200)
This could have happened only with dsync.

src/lib-storage/index/index-mail.c

index 0a04aedd3df28def2d6a6e7170d2c15fd94ced6e..cfc1480420c2751766d779bc3e1910decb73e0a5 100644 (file)
@@ -1387,8 +1387,13 @@ void index_mail_set_seq(struct mail *_mail, uint32_t seq, bool saving)
 {
        struct index_mail *mail = (struct index_mail *)_mail;
 
-       if (mail->data.seq == seq)
-               return;
+       if (mail->data.seq == seq) {
+               if (!saving)
+                       return;
+               /* we started saving a mail, aborted it, and now we're saving
+                  another mail with the same sequence. make sure the mail
+                  gets reset. */
+       }
 
        mail->mail.v.close(&mail->mail.mail);