procmail
[Top] [All Lists]

Re: Some date checking code.

2003-05-14 15:12:35

Dallman Ross wrote:

Date: Tue, 13 May 2003 09:04:20 GMT
Date: Thu, 8 May 2003 8:33:47 PDT

Are these RFC legit?  I would think that an English abbreviation
instead of a numeric UTC (which, incidentally, is what GMT is now
known as) offset may not be but I am not sure.  I suppose I could
just throw them in a big OR with the valid numeric offset but
I not sure I would trust email with a text only offset.


They are, unfortunately, legit.  See RFC2822.

Well according to an April 2001 copy I just read they are obsolete.
Of course I just got my first false positive that had 'MDT' only :-).
Anyhow as I read it this should be the final solution (yeah right
:-):

:0 H
* !^Date.*+1300( |$)
* !^Date.*(([+-](1[12]|0?[0-9])[03]0)|([PMCEA][DS]|GM|U)T|UTC)( |$)
{
  :0 H
  * $ ${WEIGHT}^0
  * 12^0
  { }
  WEIGHT="$="
  LOG="Weight adjusted for phoney timezone: $WEIGHT $NL"
}

Regarding your proposed "( |$)", a tab would also be perfectly
legit.  One of my currently archived (last-100) good pieces
of mail has tabs in the Date: header, albeit not before the
TZ info.

The only thing I care about is the space or newline after the
timezone; but I suppose it could be a tab so change the end to:
"( |       |$)".  That's a tab in the middle.

--
Daryle A. Tilroe


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>