changeset 19616:af9448bcbfd9

pop3-migration: When failing because some messages couldn't be matched, show the first message's number and UIDL This was already being done for the warning message when pop3_migration_ignore_missing_uidls was set, but not for the error message when it wasn't set.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Sun, 24 Jan 2016 16:28:29 +0200
parents 152ed3cd2bad
children 7b0a093df334
files src/plugins/pop3-migration/pop3-migration-plugin.c
diffstat 1 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/pop3-migration/pop3-migration-plugin.c	Sun Jan 24 16:27:21 2016 +0200
+++ b/src/plugins/pop3-migration/pop3-migration-plugin.c	Sun Jan 24 16:28:29 2016 +0200
@@ -4,6 +4,7 @@
 #include "array.h"
 #include "istream.h"
 #include "istream-header-filter.h"
+#include "str.h"
 #include "sha1.h"
 #include "message-size.h"
 #include "message-header-parser.h"
@@ -564,18 +565,19 @@
 		}
 	}
 	if (missing_uids_count > 0 && !mstorage->all_mailboxes) {
+		string_t *str = t_str_new(128);
+
+		str_printfa(str, "pop3_migration: %u POP3 messages have no "
+			    "matching IMAP messages (first POP3 msg %u UIDL %s)",
+			    missing_uids_count,
+			    pop3_map[first_missing_idx].pop3_seq,
+			    pop3_map[first_missing_idx].pop3_uidl);
 		if (!mstorage->ignore_missing_uidls) {
-			i_error("pop3_migration: %u POP3 messages have no "
-				"matching IMAP messages (set "
-				"pop3_migration_ignore_missing_uidls=yes "
-				"to continue anyway)", missing_uids_count);
+			i_error("%s - set pop3_migration_ignore_missing_uidls=yes to continue anyway",
+				str_c(str));
 			return -1;
 		}
-		i_warning("pop3_migration: %u POP3 messages have no "
-			  "matching IMAP messages (first POP3 msg %u UIDL %s)",
-			  missing_uids_count,
-			  pop3_map[first_missing_idx].pop3_seq,
-			  pop3_map[first_missing_idx].pop3_uidl);
+		i_warning("%s", str_c(str));
 	} else if (box->storage->user->mail_debug) {
 		i_debug("pop3_migration: %u mails matched by headers", pop3_count);
 	}