On 5/30/2017 9:29 AM, Viktor Dukhovni wrote:

On May 30, 2017, at 9:23 AM, Peter West <[email protected]> wrote:

If the return-path is <> ( empty ) then do the following ;

if domain is robbya.be or robbyb.be route via mailrobby.test.com ; if domain
is robbyc.be then route via mailrobby2.test.com

if /^Return-Path...

This is misconceived from the get-go.  The "Return-Path:" header is not
present in email in transit.  It is added at the time email is stored
into a mailbox (i.e. by the final-delivery agent) and records the
envelope sender of the message.

Isn't it misconceived in another way as well? Cf. this from http://www.postfix.org/header_checks.5.html:

"Many people overlook the main limitations of header and body_checks rules. These rules operate on one logical message header or one body line at a time. A decision made for one line is not carried over to the next line."

Doesn't this mean that an "if" used with the content of one line can't continue with a further check of the content of another line? For instance (to give an example that doesn't use Return-Path):

if /^From: [email protected]/
/^Subject: unwanted-product/ REJECT
endif

won't work because the From line isn't also a Subject line, and the result of the "if" won't be remembered from one header line to another.

--
Larry Kuenning
[email protected]

Reply via email to