procmail
[Top] [All Lists]

Re: matching Received

2006-01-07 10:11:44
Mr Duck schreef:

    VERBOSE=yes
    :0:
    * H ?? ^From:(_dot_)*(_at_)apid\(_dot_)net
    * H ?? ! ^Received:.*65\.17\.84\.226
    $DEFAULT.TRAPPED
    VERBOSE=no

When an email with our domain name comes along, the logs
show that it always matches the From: line no problems,
but its *NEVER* matches on the Received line.

I assume that the test

  * ! ^Received:.*65\.17\.84\.226

will always fail, because that IP-nr is always in one of the Received
header fields.
The negation is done after the 'real' test whether such a Received
header field is there.


If you can rely on the oldest Received header field:

     VERBOSE = 'yes'

     :0  # cd $DEFAULT
     * DEFAULT ?? ^^\/.*[^/]
     { MAILDIR = "$MATCH" }

     :0:  # test last Received header field
     *       ^From:(_dot_)*(_at_)apid\(_dot_)net>?($|,)
     *   1^1 ^Received:\/.*
     * !     MATCH ?? \[65\.17\.84\.226\]
     .TRAPPED


     VERBOSE = 'no'

(untested)


If there are always at least two Received header fields before it
(or if you need to skip at least two Received header fields)
you can use this:

     * ! ^Received:.*\
         ^Received:.*\
         ^Received:.*\[65\.17\.84\.226\]

-- 
Grtz, Ruud


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