changeset 21460:6a037631d484

lib-storage: When logging corrupted mail size, disable logging Message-ID for now This was causing crashes in some situations. It was originally added to figure out if there were problems with dovecot.index.cache containing data for wrong messages. This was never found to happen, although now thinking about it, the problem may have been 741287129c22cadc14c05584704685b31169dbce. So perhaps this code could be removed permanently as well. 6b44fc75c0039d1006ce4d543544552449b8e229 also attempted to fix this, but it wasn't enough. There was still some code path that lead to recursive header parsing.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Mon, 09 Jan 2017 23:13:03 +0200
parents f4357231951f
children 776bf892e493
files src/lib-storage/index/istream-mail.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/istream-mail.c	Mon Jan 30 15:12:04 2017 +0200
+++ b/src/lib-storage/index/istream-mail.c	Mon Jan 09 23:13:03 2017 +0200
@@ -32,8 +32,13 @@
 }
 
 static const char *
-i_stream_mail_get_cached_mail_id(struct mail_istream *mstream)
+i_stream_mail_get_cached_mail_id(struct mail_istream *mstream ATTR_UNUSED)
 {
+#if 0
+	/* FIXME: This function may get called in the middle of header parsing,
+	   which then goes into parsing cached headers and causes crashes.
+	   So disable this for now. Eventually it would be nice if recursion
+	   was possible by each parser using its own private struct. */
 	static const char *headers[] = {
 		"Message-Id",
 		"Date",
@@ -54,6 +59,9 @@
 	}
 	mail->lookup_abort = orig_lookup_abort;
 	return ret;
+#else
+	return "";
+#endif
 }
 
 static void