procmail
[Top] [All Lists]

Re: rule not working

2004-07-01 15:41:13
Curtis Maurand wrote:

Hello,
I have the following rule that's not working. Consider the following header line:

Received: from 69.49.141.146 ([211.51.78.188])

I created the following rule that didn't catch this.
:0:
* ^received: from 69.49.141.146 !.*69.49.141.146
spam

Mail should never come from 69.49.141.146 in the received from line. Is that a helo thing? anyway if it does come from 69.49.141.146 (as a host name) it should have the same ip address.
What's wrong with that rule?

This is not how regular expressions work -- your pattern tries to match "received: from 69.49.141.146" followed by " !", arbitrary text and the IP address again. ! only has special meaning in procmail when used at the beginning of a line.

Something like

:0
* ^Received: from 69.49.141.146
* !^Received:.*\[69.49.141.146\]

should come close -- this matches all lines with the IP address in the received line but no line with the address between square brackets -- using a DNS blacklist instead is probably more efficient though as a manually maintained list will grow rather quickly.

--
Klaus Johannes Rusch
KlausRusch(_at_)atmedia(_dot_)net
http://www.atmedia.net/KlausRusch/


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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