changeset 19647:8f2ba9ebc463

pop3-migration: If reading message header for hashing fails, fail immediately. This avoids flooding the log with a ton of errors in case the POP3 connection dies.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Tue, 26 Jan 2016 22:10:29 +0200
parents 25f06710e671
children 40298bc52160
files src/plugins/pop3-migration/pop3-migration-plugin.c
diffstat 1 files changed, 4 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/pop3-migration/pop3-migration-plugin.c	Tue Jan 26 19:56:43 2016 +0200
+++ b/src/plugins/pop3-migration/pop3-migration-plugin.c	Tue Jan 26 22:10:29 2016 +0200
@@ -476,10 +476,11 @@
 	while (mailbox_search_next(ctx, &mail)) {
 		map = array_idx_modifiable_i(msg_map, mail->seq-1);
 
-		if (get_hdr_sha1(mail, map->hdr_sha1) < 0)
+		if (get_hdr_sha1(mail, map->hdr_sha1) < 0) {
 			ret = -1;
-		else
-			map->hdr_sha1_set = TRUE;
+			break;
+		}
+		map->hdr_sha1_set = TRUE;
 	}
 
 	if (mailbox_search_deinit(&ctx) < 0) {