Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Postfix header_checks order
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
salam
Apprentice
Apprentice


Joined: 29 Sep 2005
Posts: 221

PostPosted: Thu Jul 01, 2021 10:53 am    Post subject: Postfix header_checks order Reply with quote

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?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum