[SOLVED] Mail Filter / Whitelisting Addresses

XN-Matt

Well-Known Member
Aug 21, 2017
92
7
48
43
We've tried whitelisting some addresses against the whole system which always fail spam checks but are valid.

We have a WHO record created trying to match the address in each way:

Reg exp: "*.@domain.com"
Email: "specificemail@domain.com"
Domain: "domain.com"

They are set within the filter with a prio of 85 with actions of ACCEPT and to: the WHO list above.

These never seem to work and the messages always then match with the last rule (prio 80) which checks for a score of 4 or more, sets a header and keeps in quarantine.

What could be going wrong?
 
Last edited:
The only thing i've been able to find as the possible cause is logging shows the From as the Return-Path:

```Jan 11 23:34:05 mxg2 postfix/smtpd[222092]: proxy-accept: END-OF-MESSAGE: 250 2.5.0 OK (4CB7963BF476BBCF83); from=<bounces+xxxx-6205-xxxx=xxxx.co.uk@em2614.xxxxx.co.uk> to=<xxxx@xxxx.co.uk> proto=ESMTP helo=<o168-245-117-49.outbound-mail.sendgrid.net>```

It's fair to say, our rules are written for the From address which does match the headers. It does not reflect the Return-Path address.

Should the whitelist rules be written to match the address seen in the Return-Path instead?
 
* The Who objects match the envelope-addresses of a mail (this is what you see as Return-Path in your mail-client)
* If you want to match the From header of a mail - use a What Object (Match Field, with a field 'From')

I hope this explains it!
 
Thanks - that does.

It may be an ideal to improve the documentation on this with some examples as that's pretty limited.