Giampaolo Tomassoni wrote:
-----Original Message-----
From: Leonardo Rodrigues Magalhães [mailto:[EMAIL PROTECTED]
Sent: Monday, June 16, 2008 2:52 AM
To: ML spamassassin
Subject: Re: rule based on time



John Hardin escreveu:
Yes. Write a regex that checks the time from of the Received: header
that your MTA adds.

Post a sample Received: header from your MTA and I'll take a shot at
it.
    Received line added by my MTA, which is a postfix, would be
something like:


Received: from smtp2.mailcluster.com.br (smtp2.mailcluster.com.br
[209.85.59.204])
    by correio.mydomain.com.br (Postfix) with SMTP id 22CA4138002
    for <[EMAIL PROTECTED]>; Sun, 15 Jun 2008 21:35:50 -0300
(BRT)

Try the following, then:

header NIGTHMARE Received =~ m'by correio\.mydomain\.
com\.br\s.*\s(?:2[1-3]|0[0-6])(?::[0-9]{2}){2}'
describe NIGHTMARE Bad things you get during night
score NIGHTMARE 1.000


it is safer to put the ';' separator (to avoid catching some mysterious "for [EMAIL PROTECTED]").

header NIGHTMARE Received =~ m|by correio\.solutti\.com\.br \(Postfix\) .*;.*\s(2\d|0?[0-6]):\d{2}:\d{2}|

note that such checks should not be used with fetchmail/getmail nor if local "loop"s (multiple "by $server") occur.

Reply via email to