procmail
[Top] [All Lists]

RE: Multiline Received header not being matched

2004-02-13 09:06:08



From: David Stone
Sent: Friday, February 13, 2004 6:31 AM
[...]

:0f
* ^Received: from.* \(\[[0-9]+(.*$)[  ]+by example\.com
| formail -A "X-SpamTest: Sending MTA has no rDNS"

(The [] enclose a space and a tab)


Above, the $-sign won't work, because procamil has collapsed the header line
continuations into a single line. the construct (.*$) will match everything
to the end of the line, which will include 'by example.com'. I'd write this
as:

SPACE=" "
TAB="   "
WS="$SPACE$TAB"

:0 h fw
* $ ^Received:[$WS]+from.*[$WS]\(\[[0-9].*\<by example\.com
| formail -A "X-SpamTest: Sending MTA has no rDNS"

This worked for me. Note that I added the 'h' (header only filter)
and 'w' (wait for result) flags.



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