procmail
[Top] [All Lists]

Re: Some date checking code.

2003-05-13 15:14:05


Dallman Ross wrote:
On Mon, May 12, 2003 at 06:58:26PM -0600, Daryle A. Tilroe wrote:

:0 H
* ^Date.*\/[+-]1[4-9]00|\
 ^Date.*\/[+-][2-9][0-9]00


More efficient:

        :0
        * ^Date:.*\/[+-](1[4-9]|2-9][0-9])00


Yup.  The former was just a bit more readable

The `H' flag is default, so you don't need it.

Yeah, I know.  Just my paranoia and also my desire
to have the scope explicit.

I'll note that +1300 is legit but not -1300.

Perhaps I could just add an 'OR' line for it or
better yet just exclude it and filter non 00 and
30 endings while I am at it by going to exclusive
rather than inclusive logic, i.e. (I'm not sure why
I was using the match before, an unthinking cut 'n
paste probably):

:0 H
* !^Date.*+1300
* !^Date.*[+-](1[12]|0?[0-9])[03]0

> Also, some mailers do prepend a leading zero; so your
> case of 1[4-9]|[2-9] will fail in that situation.

What do you mean here?  Something like '-01100'?  That
should be solved with a leading '0?' but have you
seen this in real life?


 LOG="Weight adjusted for date more than 2 days in the future: $WEIGHT $NL"


I find that anything more than an hour in the future is almost certain
spam, after I whitelist out mailing lists and expected commercial mail.

Could probably tighten it up quite a bit for the future once I
get a bit more comfortable.

 LOG="Weight adjusted for date more than 4 days in the past: $WEIGHT $NL"


I give six hours for delivery.  At that point in my rc, the whitelists
are over, so what's left was iffy to begin with.


I could probably tighten this up a bit too but generally I believe
MTAs have timeouts approaching 3 days.  If if there are mail
interuptions I would not want to tag a pile of legit mail as spam
merely because it was a few days late.

--
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>