Skip to content

Commit

Permalink
lib-storage: When logging corrupted mail size, disable logging Messag…
Browse files Browse the repository at this point in the history
…e-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
7412871. So perhaps this code could be
removed permanently as well.

6b44fc7 also attempted to fix this, but it
wasn't enough. There was still some code path that lead to recursive header
parsing.
  • Loading branch information
sirainen authored and GitLab committed Jan 31, 2017
1 parent 6c7b2d5 commit 4e87679
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/lib-storage/index/istream-mail.c
Expand Up @@ -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",
Expand All @@ -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
Expand Down

0 comments on commit 4e87679

Please sign in to comment.