procmail
[Top] [All Lists]

Re: Spam with date set in the future

2002-06-30 22:45:03
Alan Clifford <lists(_at_)clifford(_dot_)ac> writes:

Date seems good at parsing dates and I am not into reinventing the wheel,
so:
[snip stuff using GNU date]

and secondly, I found an example of a bad date in a spam that didn't cause
date to fail:

date -d "Wed, Jun 2002  23:01:09"
gives:
Fri Nov 23 23:01:09 GMT 2007

As it happens, this result is OK for the next 5 years as variations of
this always seem to result in the year 2007 but it is not ideal.

Date is just making its best effort.

Try this:
        date -d "Wed, Jun 31 23:01:09"
and you should get something like
        Mon Jul  1 23:01:09 GMT 2002
which should show you how date is trying hard to figure it out.
It's actually very convenient for things like figuring out what
60 days after June 10 is (just feed it "June 70").

November 23, 2007 is 2002 days after May 31, 2002, which is how
it's parsing "Wed, Jun 2002" (it ignores the "Wed," and it assumes
the current year).

Cheers,
Stan
_______________________________________________
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>