salam Apprentice
Joined: 29 Sep 2005 Posts: 221
|
Posted: Thu Jul 01, 2021 10:53 am Post subject: Postfix header_checks order |
|
|
For testing new configuration, I need to set exception in delivery.
Incoming mail gets to content_filter according to master.cf, then it is sent to queue again
So I set header_checks like this:
Code: | /^To:\sme@xxx\.com/ PASS For spam testing
/^X-Spam-Status:\sYes/ REDIRECT spamfilter@xxx.com |
Then I send a test mail that is 100% spam. This happens:
Code: | postfix/cleanup[49016]: 8C3AF60136: pass: header To: me@xxx.com from xxx.net[IP]; from=<test@xxx.net> to=<me@xxx.com> proto=ESMTP helo=<xxx.net>: For spam testing
...
...
spamd[34830]: spamd: result: Y 1000 - GTUBE ......
...
...
postfix/cleanup[49966]: 9D680601D0: redirect: header X-Spam-Status: Yes.....
|
So round 1 is OK, "To" is matched, rule checking should stop. Then content_filter is applied and mail is again in delivery. But no "To:" is checked, even if it is first rule in header_checks.
Why is redirect applied first?
If i replace redirect with hold, it is clearly visible that it is first rule to be checked:
Code: | 8C3AF60136: pass: header To:.....
...
...
spamd[34830]: spamd: result: Y 1000 - GTUBE
...
...
postfix/cleanup[49016]: 3E589601CF: hold: header X-Spam-Status: Yes.....
postfix/cleanup[49016]: 3E589601CF: pass: header To:..... |
From manual:
Code: |
TABLE SEARCH ORDER
For each line of message input, the patterns are applied in the order
as specified in the table. When a pattern is found that matches the
input line, the corresponding action is executed and then the next
input line is inspected.
|
Why is second rule executed before first? |
|