changeset 12672:384d8615039f

dbox: If mail GUID is changed for copied mail, create a new copy of it so it changes.
author Timo Sirainen <tss@iki.fi>
date Mon, 03 Jan 2011 18:57:05 +0200
parents c1e71f579adc
children 2b8d7b6bcfc7
files src/lib-storage/index/dbox-multi/mdbox-save.c src/lib-storage/index/dbox-single/sdbox-copy.c
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/dbox-multi/mdbox-save.c	Sat Jan 01 14:34:14 2011 +0200
+++ b/src/lib-storage/index/dbox-multi/mdbox-save.c	Mon Jan 03 18:57:05 2011 +0200
@@ -409,7 +409,8 @@
 	ctx->ctx.finished = TRUE;
 
 	if (mail->box->storage != _ctx->transaction->box->storage ||
-	    _ctx->transaction->box->disable_reflink_copy_to)
+	    _ctx->transaction->box->disable_reflink_copy_to ||
+	    _ctx->guid != NULL)
 		return mail_storage_copy(_ctx, mail);
 	src_mbox = (struct mdbox_mailbox *)mail->box;
 
--- a/src/lib-storage/index/dbox-single/sdbox-copy.c	Sat Jan 01 14:34:14 2011 +0200
+++ b/src/lib-storage/index/dbox-single/sdbox-copy.c	Mon Jan 03 18:57:05 2011 +0200
@@ -148,7 +148,8 @@
 	i_assert((_t->flags & MAILBOX_TRANSACTION_FLAG_EXTERNAL) != 0);
 
 	ctx->finished = TRUE;
-	if (mail_storage_copy_can_use_hardlink(mail->box, &mbox->box)) {
+	if (mail_storage_copy_can_use_hardlink(mail->box, &mbox->box) &&
+	    _ctx->guid == NULL) {
 		T_BEGIN {
 			ret = sdbox_copy_hardlink(_ctx, mail);
 		} T_END;