diff --git a/mail.c b/mail.c index a3ece3a..bf82d52 100644 --- a/mail.c +++ b/mail.c @@ -354,6 +354,7 @@ readmail(struct queue *queue, int nodot, int recp_from_header) int had_from = 0; int had_messagid = 0; int had_date = 0; + int had_first_line = 0; int had_last_line = 0; int nocopy = 0; @@ -391,6 +392,15 @@ readmail(struct queue *queue, int nodot, int recp_from_header) line[linelen + 1] = 0; had_last_line = 1; } + if (!had_first_line) { + /* + * Ignore a leading RFC-976 From_ or >From_ line mistakenly + * inserted by some programs. + */ + if (strprefixcmp(line, "From ") == 0 || strprefixcmp(line, ">From ") == 0) + continue; + had_first_line = 1; + } if (!had_headers) { /* * Unless this is a continuation, switch of