On 5/6/2010 4:15 AM, Tom Hendrikx wrote:
On 06/05/10 10:58, Louis-David Mitterrand wrote:
On Wed, May 05, 2010 at 01:44:54PM -0400, Brian Evans - Postfix List wrote:

You could try this in /etc/postfis/header_checks

if 
/^(Received|X-((Origin(ating)?|Client|MDRemote|Sender)-?IP|(Client|Remote_)Addr|PHP-Script)):/
        if 
!/^(X-Original-)?To:[...@]*(africanspamlover1|africanspamlover2|etc..)@/
                /\b(41\.1(6\d|7[0-5])\.\d+\.\d+)\b/ REJECT african spam rule 1
                /\b(41\.3(6\d|7[0-5])\.\d+\.\d+)\b/ REJECT african spam rule 2
                .. and all other rules ...
        endif
endif

This will not work.
Postfix analyzes headers one at a time.
You cannot check multiple headers at once in header_checks.
You need a milter or other filter to do that.

Could this be entered as a postfix wishlist item then? A 'm' flag to
pcre_table that would match on the whole headers (instead of
line-by-line), akin to Perl's 'm' regexp flag:

        m   Treat string as multiple lines.  That is, change "^" and "$" from
                matching the start or end of the string to matching the start or
                end of any line anywhere within the string.

It would be very powerful, yet retain the ability to match on any
individual header line with ^ and $ anchors.


Hi,

I think that postfwd can do all of this already, working as a policy
daemon. See http://www.postfwd.org/

No need to complicate postfix any further: it is an MTA, and should
concentrate on mail delivery. There is a reason that you can hook up a
myriad of external tools into postfix.

--
Regards,
        Tom


No, postfwd cannot examine message headers; policy services do not have access to headers. You must use a content_filter, proxy, or milter to process message contents.

   -- Noel Jones

Reply via email to