dovecot: Get UIDVALIDITY after transaction was committed. It may...

dovecot at dovecot.org dovecot at dovecot.org
Wed Jul 18 00:03:27 EEST 2007


details:   http://hg.dovecot.org/dovecot/rev/b407586a5107
changeset: 6046:b407586a5107
user:      Timo Sirainen <tss at iki.fi>
date:      Wed Jul 18 00:02:31 2007 +0300
description:
Get UIDVALIDITY after transaction was committed. It may have changed.

diffstat:

1 file changed, 4 insertions(+), 7 deletions(-)
src/imap/cmd-copy.c |   11 ++++-------

diffs (28 lines):

diff -r 840fb333defd -r b407586a5107 src/imap/cmd-copy.c
--- a/src/imap/cmd-copy.c	Tue Jul 17 23:58:58 2007 +0300
+++ b/src/imap/cmd-copy.c	Wed Jul 18 00:02:31 2007 +0300
@@ -135,12 +135,6 @@ bool cmd_copy(struct client_command_cont
 				      MAILBOX_TRANSACTION_FLAG_ASSIGN_UIDS);
 	ret = fetch_and_copy(client, t, search_arg, &src_uidset, &copy_count);
 
-	if (ret > 0 &&
-	    mailbox_get_status(destbox, STATUS_UIDVALIDITY, &status) < 0) {
-		client_send_storage_error(cmd, storage);
-		ret = -1;
-	}
-
 	if (ret <= 0)
 		mailbox_transaction_rollback(&t);
 	else if (mailbox_transaction_commit_get_uids(&t, 0, &uid1, &uid2) < 0)
@@ -148,7 +142,10 @@ bool cmd_copy(struct client_command_cont
 	else {
 		i_assert(copy_count == uid2 - uid1 + 1);
 
-		if (uid1 == uid2) {
+		if (mailbox_get_status(destbox, STATUS_UIDVALIDITY,
+				       &status) < 0) {
+			msg = "OK Copy completed. UIDVALIDITY lookup failed.";
+		} else if (uid1 == uid2) {
 			msg = t_strdup_printf("OK [COPYUID %u %s %u] "
 					      "Copy completed.",
 					      status.uidvalidity,


More information about the dovecot-cvs mailing list