]> 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)
committerGitLab <gitlab@git.dovecot.net>
Tue, 31 Jan 2017 06:57:09 +0000 (08:57 +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 67ac7dbc49dfdcb97ff9360b1ff150ea09047b4d..a5bfcfbda5e4367feef7d1cdcdcc14c7c79bce1c 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