dovecot-2.2: pop3-migration: Added more debug and error logging.

dovecot at dovecot.org dovecot at dovecot.org
Sat May 9 18:24:45 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/3903badc4ee0
changeset: 18624:3903badc4ee0
user:      Timo Sirainen <tss at iki.fi>
date:      Sat May 09 21:22:50 2015 +0300
description:
pop3-migration: Added more debug and error logging.

diffstat:

 src/plugins/pop3-migration/pop3-migration-plugin.c |  29 ++++++++++++++++++---
 1 files changed, 24 insertions(+), 5 deletions(-)

diffs (86 lines):

diff -r 8b20d717a3e9 -r 3903badc4ee0 src/plugins/pop3-migration/pop3-migration-plugin.c
--- a/src/plugins/pop3-migration/pop3-migration-plugin.c	Sat May 09 20:29:55 2015 +0300
+++ b/src/plugins/pop3-migration/pop3-migration-plugin.c	Sat May 09 21:22:50 2015 +0300
@@ -286,8 +286,11 @@
 		map->size = size;
 	}
 
-	if (mailbox_search_deinit(&ctx) < 0)
+	if (mailbox_search_deinit(&ctx) < 0) {
+		i_error("pop3_migration: Failed to search all POP3 mails: %s",
+			mailbox_get_last_error(pop3_box, NULL));
 		ret = -1;
+	}
 	(void)mailbox_transaction_commit(&t);
 	return ret;
 }
@@ -331,8 +334,11 @@
 			map->hdr_sha1_set = TRUE;
 	}
 
-	if (mailbox_search_deinit(&ctx) < 0)
+	if (mailbox_search_deinit(&ctx) < 0) {
+		i_error("pop3_migration: Failed to search all POP3 mail hashes: %s",
+			mailbox_get_last_error(pop3_box, NULL));
 		ret = -1;
+	}
 	(void)mailbox_transaction_commit(&t);
 	if (ret == 0 && first_seq == 1)
 		mstorage->pop3_all_hdr_sha1_set = TRUE;
@@ -377,8 +383,11 @@
 		map->psize = psize;
 	}
 
-	if (mailbox_search_deinit(&ctx) < 0)
+	if (mailbox_search_deinit(&ctx) < 0) {
+		i_error("pop3_migration: Failed to search all IMAP mails: %s",
+			mailbox_get_last_error(box, NULL));
 		ret = -1;
+	}
 	(void)mailbox_transaction_commit(&t);
 	return ret;
 }
@@ -410,8 +419,11 @@
 			map->hdr_sha1_set = TRUE;
 	}
 
-	if (mailbox_search_deinit(&ctx) < 0)
+	if (mailbox_search_deinit(&ctx) < 0) {
+		i_error("pop3_migration: Failed to search all IMAP mail hashes: %s",
+			mailbox_get_last_error(box, NULL));
 		ret = -1;
+	}
 	(void)mailbox_transaction_commit(&t);
 	return ret;
 }
@@ -443,6 +455,8 @@
 		imap_map[i].pop3_seq = pop3_map[i].pop3_seq;
 	}
 	mbox->first_unfound_idx = i;
+	if (box->storage->user->mail_debug)
+		i_debug("pop3_migration: %u/%u mails matched by size", i, count);
 	return i == count;
 }
 
@@ -511,6 +525,8 @@
 		}
 		i_warning("pop3_migration: %u POP3 messages have no "
 			  "matching IMAP messages", missing_uids_count);
+	} else if (box->storage->user->mail_debug) {
+		i_debug("pop3_migration: %u mails matched by headers", pop3_count);
 	}
 	array_sort(&mstorage->pop3_uidl_map, pop3_uidl_map_pop3_seq_cmp);
 	array_sort(&mbox->imap_msg_map, imap_msg_map_uid_cmp);
@@ -666,8 +682,11 @@
 
 	pop3_box_vname = mail_user_plugin_getenv(storage->user,
 						 "pop3_migration_mailbox");
-	if (pop3_box_vname == NULL)
+	if (pop3_box_vname == NULL) {
+		if (storage->user->mail_debug)
+			i_debug("pop3_migration: No pop3_migration_mailbox setting - disabled");
 		return;
+	}
 
 	mstorage = p_new(storage->pool, struct pop3_migration_mail_storage, 1);
 	mstorage->module_ctx.super = *v;


More information about the dovecot-cvs mailing list