]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: When logging corrupted mail size, disable logging Message-ID for now
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 9 Jan 2017 21:13:03 +0000 (23:13 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 31 Jan 2017 07:00:15 +0000 (09:00 +0200)
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.

src/lib-storage/index/istream-mail.c

index fa955a1ba9a8d10fa6da2907b8762751741538d5..f49e7ef78ecda406945a2d6b95f27913a43d531d 100644 (file)
@@ -32,8 +32,13 @@ static bool i_stream_mail_try_get_cached_size(struct mail_istream *mstream)
 }
 
 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 @@ i_stream_mail_get_cached_mail_id(struct mail_istream *mstream)
        }
        mail->lookup_abort = orig_lookup_abort;
        return ret;
+#else
+       return "";
+#endif
 }
 
 static void