From: Dan Harkless Date: Tue, 14 Mar 2000 20:40:47 +0000 (+0000) Subject: Applied Simon Burge 's dtimep.lex patch: X-Git-Tag: nmh-1_0~61 X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=6a471c368b128394153c13c6d8f55cf0855f5779;p=mmh Applied Simon Burge 's dtimep.lex patch: It seems that some MUA's didn't handle y2k very well - ELM seems to be one of them, and Ultrix's DXmail (based on MH!). I've got a few emails this month that look like: 575 Jan 00 Xxxxxx Xxxx 3603 ... and 22+ Jan 00 Xxx Xxxxx 1771 ... The first has "15 Jan 100" as the date and the second has "19 Jan 00" as the date. The following works around this so that scan, show, sortm, etc work ok. Added scan.MMDDYY and scan.YYYYMMDD format files. --- diff --git a/ChangeLog b/ChangeLog index f4dfb1a..cde4c5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -Tue Mar 14 01:14:13 2000 Dan Harkless +Tue Mar 14 12:41:48 2000 Dan Harkless * Applied, after some finessing, Simon Burge 's --with-smtpservers patch: @@ -31,6 +31,22 @@ Tue Mar 14 01:14:13 2000 Dan Harkless --enable-masquerade or --with-smtpservers, you'll fail to get an updated copy of mts.conf. + * Applied Simon Burge 's dtimep.lex patch: + + It seems that some MUA's didn't handle y2k very well - ELM + seems to be one of them, and Ultrix's DXmail (based on MH!). + I've got a few emails this month that look like: + + 575 Jan 00 Xxxxxx Xxxx 3603 ... + and + 22+ Jan 00 Xxx Xxxxx 1771 ... + + The first has "15 Jan 100" as the date and the second has + "19 Jan 00" as the date. The following works around this so + that scan, show, sortm, etc work ok. + + * Added scan.MMDDYY and scan.YYYYMMDD format files. + Mon Mar 13 21:32:00 2000 Dan Harkless * Applied Sullivan N. Beck 's mhshow-suffix patch: diff --git a/acconfig.h b/acconfig.h index 15178d7..1050be7 100644 --- a/acconfig.h +++ b/acconfig.h @@ -52,11 +52,25 @@ /* * Define this if you do not want nmh to attach the local hostname * to local addresses. You must also define DUMB. You probably - * dont' need this unless you are behind a firewall. + * don't need this unless you are behind a firewall. */ /* #define REALLYDUMB 1 */ /* + * Starting on January 1, 2000, some MUAs like ELM and Ultrix's DXmail started + * generated bad dates ("00" or "100" for the year). If this #define is active, + * we use windowing to correct those dates to what we presume to be the intended + * values. About the only time this could get us into trouble would be if a MUA + * was generating a year of "00" in 2001 or later, due to an unrelated bug. In + * this case we would "correct" the year to 2000, which could result in + * inaccurate bug reports against the offending MUA. A much more esoteric case + * in which you might not want to #define this would be if you were OCR'ing in + * old written correspondence and saving it in email format, and you had dates + * of 1899 or earlier. + */ +#define FIX_NON_Y2K_COMPLIANT_MUA_DATES 1 + +/* * Directs inc/slocal to extract the envelope sender from "From " * line. If inc/slocal is saving message to folder, then this * sender information is then used to create a Return-Path diff --git a/config.h.in b/config.h.in index b9b9ed1..89b10e8 100644 --- a/config.h.in +++ b/config.h.in @@ -53,11 +53,25 @@ /* * Define this if you do not want nmh to attach the local hostname * to local addresses. You must also define DUMB. You probably - * dont' need this unless you are behind a firewall. + * don't need this unless you are behind a firewall. */ /* #define REALLYDUMB 1 */ /* + * Starting on January 1, 2000, some MUAs like ELM and Ultrix's DXmail started + * generated bad dates ("00" or "100" for the year). If this #define is active, + * we use windowing to correct those dates to what we presume to be the intended + * values. About the only time this could get us into trouble would be if a MUA + * was generating a year of "00" in 2001 or later, due to an unrelated bug. In + * this case we would "correct" the year to 2000, which could result in + * inaccurate bug reports against the offending MUA. A much more esoteric case + * in which you might not want to #define this would be if you were OCR'ing in + * old written correspondence and saving it in email format, and you had dates + * of 1899 or earlier. + */ +#define FIX_NON_Y2K_COMPLIANT_MUA_DATES 1 + +/* * Directs inc/slocal to extract the envelope sender from "From " * line. If inc/slocal is saving message to folder, then this * sender information is then used to create a Return-Path diff --git a/etc/Makefile.in b/etc/Makefile.in index 42f38e6..2f78e34 100644 --- a/etc/Makefile.in +++ b/etc/Makefile.in @@ -38,10 +38,10 @@ SED = sed # format and components files DIST_FILES = mhl.body mhl.digest mhl.format mhl.forward mhl.headers \ - mhl.reply scan.default scan.mailx scan.nomime scan.size scan.time \ - scan.timely scan.unseen components digestcomps distcomps \ - forwcomps rcvdistcomps rcvdistcomps.outbox replcomps \ - replgroupcomps MailAliases + mhl.reply scan.MMDDYY scan.YYYYMMDD scan.default scan.mailx \ + scan.nomime scan.size scan.time scan.timely scan.unseen components\ + digestcomps distcomps forwcomps rcvdistcomps rcvdistcomps.outbox\ + replcomps replgroupcomps MailAliases # format and configuration files to generate GEN_FILES = mhn.defaults mts.conf diff --git a/etc/scan.MMDDYY b/etc/scan.MMDDYY new file mode 100644 index 0000000..d79ad3c --- /dev/null +++ b/etc/scan.MMDDYY @@ -0,0 +1,10 @@ +%; scan.MMDDYY +%; +%; Like scan.default, but the date is printed in MM/DD/YY format rather than +%; MM/DD. Allows one less column for the message number in order to make space. +%; +%3(msg)%<(cur)+%| %>%<{replied}-%?{encrypted}E%| %>\ +%02(mon{date})/%02(mday{date})/%(void(year{date}))%02(modulo 100)%<{date} %|*%>\ +%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ +%<(zero)%17(decode(friendly{from}))%> \ +%(decode{subject})%<{body}<<%{body}>>%> diff --git a/etc/scan.YYYYMMDD b/etc/scan.YYYYMMDD new file mode 100644 index 0000000..626ab74 --- /dev/null +++ b/etc/scan.YYYYMMDD @@ -0,0 +1,11 @@ +%; scan.YYYYMMDD +%; +%; Like scan.default, but the date is printed in YYYY-MM-DD format rather than +%; MM/DD. Allows one less column for the message number and leaves out the +%; apparently little-used replied/encrypted column in order to make space. +%; +%3(msg)%<(cur)+%| %>\ +%4(year{date})-%02(mon{date})-%02(mday{date})%<{date} %|*%>\ +%<(mymbox{from})%<{to}To:%14(decode(friendly{to}))%>%>\ +%<(zero)%17(decode(friendly{from}))%> \ +%(decode{subject})%<{body}<<%{body}>>%> diff --git a/stamp-h.in b/stamp-h.in index ec0a3ef..f790c36 100644 --- a/stamp-h.in +++ b/stamp-h.in @@ -1 +1 @@ -Tue Mar 14 00:50:37 PST 2000 +Tue Mar 14 12:00:13 PST 2000 diff --git a/zotnet/tws/dtimep.lex b/zotnet/tws/dtimep.lex index 467dc85..ab2e4f5 100644 --- a/zotnet/tws/dtimep.lex +++ b/zotnet/tws/dtimep.lex @@ -257,6 +257,16 @@ dparsetime (char *str) for (i = 0; isdigit(*cp); ) i = i*10 + (*cp++ - '0'); tw.tw_year = i; +#ifdef FIX_NON_Y2K_COMPLIANT_MUA_DATES + /* handle broken mua's that don't add + 1900, or just use the last two + digits. Assume no email before + 1972. */ + if (tw.tw_year < 72) + tw.tw_year += 100; + if (tw.tw_year < 1900) + tw.tw_year += 1900; +#endif /* FIX_NON_Y2K_COMPLIANT_MUA_DATES */ } {D}"-"?{MONTH}({W}at)?{w} { tw.tw_mday = CVT1OR2;