NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/47453: Mail (mail, mailx) does not recognize messages which have RFC 822 format dates.

>Number:         47453
>Category:       bin
>Synopsis:       Mail (mail, mailx) does not recognize messages which have RFC 
>822 format dates.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 15 17:15:00 +0000 2013
>Originator:     Martin Brandenburg
>Release:        6.0.1
NetBSD [hostname] 6.0.1 NetBSD 6.0.1 (XEN3_DOMU) amd64
The BSD mail program (mail, mailx, Mail) does not recognize mailboxes with From 
headers containing RFC 822 format dates. Such files are generated by uw-imap, 
popular Python mail scripts, and probably by many others.

Examples of corrent and offending headers follow:
From address Tue Jan 15 16:49:46 2013
From address Tue Jan 15 10:06:37 2013 +0000

Mail silently drops any messages with headers in the latter format.

As no standard for the format of mailbox files exists and in the interests of 
interoperability, mail should accept such formats.
Generate such a mailbox, either by hand or with uw-imap's mailutil. Run mail -f 
mbox on it and observe the dropped messages.
Index: usr.bin/mail/head.c
RCS file: /cvsroot/src/usr.bin/mail/head.c,v
retrieving revision 1.22
diff -r1.22 head.c
>               case '+':
>                       if (*cp++ != '+' && *cp != '-')
>                               return 0;
>                       break;
>  * '+'        A plus or minus sign
> static char rfc822type[] = "Aaa Aaa O0 00:00:00 0000 +0000";
> static char rfc822alttype[] = "Aaa Aaa O0 00:00:00 0000 AAA";
<              cmatch(date, SysV_tmztype) || cmatch(date, SysV_ctype);
>              cmatch(date, SysV_tmztype) || cmatch(date, SysV_ctype) ||
>              cmatch(date, rfc822type) || cmatch(date, rfc822alttype);

Home | Main Index | Thread Index | Old Index