diff options
author | mikeh <mikeh@FreeBSD.org> | 2003-01-09 05:08:37 +0000 |
---|---|---|
committer | mikeh <mikeh@FreeBSD.org> | 2003-01-09 05:08:37 +0000 |
commit | 44c0edb0a02606510434bdf88e62239b6c4e32e9 (patch) | |
tree | 9b7ecfcc36ec23a99352678541a5a31c43af39fb | |
parent | db763e9b6c3bead3f86d675cdae13fc74990f19d (diff) | |
download | FreeBSD-src-44c0edb0a02606510434bdf88e62239b6c4e32e9.zip FreeBSD-src-44c0edb0a02606510434bdf88e62239b6c4e32e9.tar.gz |
The return-path is optional in a headline, therefore don't skip a
message if it is missing the return-path.
PR: bin/40314 (slightly different patch)
MFC after: 2 weeks
-rw-r--r-- | usr.bin/mail/head.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/usr.bin/mail/head.c b/usr.bin/mail/head.c index 0924944..90db962 100644 --- a/usr.bin/mail/head.c +++ b/usr.bin/mail/head.c @@ -60,11 +60,11 @@ ishead(linebuf) struct headline hl; char parbuf[BUFSIZ]; - if (strncmp(linebuf, "From ", 5)) + if (strncmp(linebuf, "From ", 5) != 0) return (0); parse(linebuf, &hl, parbuf); - if (hl.l_from == NULL || hl.l_date == NULL) { - fail(linebuf, "No from or date field"); + if (hl.l_date == NULL) { + fail(linebuf, "No date field"); return (0); } if (!isdate(hl.l_date)) { @@ -113,10 +113,17 @@ parse(line, hl, pbuf) * Skip over "From" first. */ cp = nextword(cp, word); + /* + * Check for missing return-path. + */ + if (isdate(cp)) { + hl->l_date = copyin(cp, &sp); + return; + } cp = nextword(cp, word); - if (*word != '\0') + if (strlen(word) > 0) hl->l_from = copyin(word, &sp); - if (cp != NULL && cp[0] == 't' && cp[1] == 't' && cp[2] == 'y') { + if (cp != NULL && strncmp(cp, "tty", 3) == 0) { cp = nextword(cp, word); hl->l_tty = copyin(word, &sp); } |