dovecot-2.2: lib-storage: mailbox_save_cancel() now makes sure t...

dovecot at dovecot.org dovecot at dovecot.org
Mon Oct 29 17:55:53 EET 2012


details:   http://hg.dovecot.org/dovecot-2.2/rev/3de5a5b49580
changeset: 15294:3de5a5b49580
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Oct 03 01:20:22 2012 +0300
description:
lib-storage: mailbox_save_cancel() now makes sure that dest_mail is reset.
This fixes e.g. doveadm import, which continues import even though some
messages couldn't be saved.

diffstat:

 src/lib-storage/mail-storage.c |  8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diffs (23 lines):

diff -r 4c3dac1a94cf -r 3de5a5b49580 src/lib-storage/mail-storage.c
--- a/src/lib-storage/mail-storage.c	Wed Oct 03 01:19:19 2012 +0300
+++ b/src/lib-storage/mail-storage.c	Wed Oct 03 01:20:22 2012 +0300
@@ -1680,11 +1680,19 @@
 {
 	struct mail_save_context *ctx = *_ctx;
 	struct mail_keywords *keywords = ctx->keywords;
+	struct mail_private *mail;
 
 	*_ctx = NULL;
 	ctx->transaction->box->v.save_cancel(ctx);
 	if (keywords != NULL)
 		mailbox_keywords_unref(&keywords);
+	if (ctx->dest_mail != NULL) {
+		/* the dest_mail is no longer valid. if we're still saving
+		   more mails, the mail sequence may get reused. make sure
+		   the mail gets reset in between */
+		mail = (struct mail_private *)ctx->dest_mail;
+		mail->v.close(&mail->mail);
+	}
 }
 
 struct mailbox_transaction_context *


More information about the dovecot-cvs mailing list