diff options
author | Alexander Sulfrian <asulfrian@zedat.fu-berlin.de> | 2021-07-09 11:49:26 +0200 |
---|---|---|
committer | Kevin McCarthy <kevin@8t8.us> | 2021-07-09 06:07:54 -0700 |
commit | 94f5f35a3ad29ac6dbb8b2df2226154de954127a (patch) | |
tree | 1f23bd13432681e5f950bbc0e6177dcad9389e7e | |
parent | f5ccd687348a8a97bb442d031bdd4e68091615c0 (diff) |
listmenu: Fix parsing of list headers for mbox
The parsing of the headers needs to skip the "From " lines at the start
of the messages in mbox format. This now uses the same logic like
mutt_read_rfc822_header in parse.c.
-rw-r--r-- | listmenu.c | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -91,7 +91,15 @@ static void parse_list_headers (CONTEXT *ctx, HEADER *hdr, while (*(line = mutt_read_rfc822_line (msg->fp, line, &linelen)) != 0) { if ((p = strpbrk (line, ": \t")) == NULL || *p != ':') + { + /* some bogus MTAs will quote the original "From " line */ + if (mutt_strncmp (">From ", line, 6) == 0) + continue; /* just ignore */ + else if (is_from (line, NULL, 0, NULL)) + continue; /* just ignore */ + break; /* end of header */ + } h = line; /* header */ *p = 0; |