0

I want to whitelist certain domains in spamassassin only if the recipient is also in a specific domain. As far as I can tell from the documentation, there seems to be no way to configure this requirement:

  • Sender@Domain.one sends mail to Recipient@Domain.two -> Spamassassin should whitelist this mail
  • Sender@Domain.one sends mail to other recipients (also on the same server, but different domain) -> Spamassassin should check the mail before forwarding it to the recipient

I've already added whitelist_from *@domain.one in my spamassassin config but this is a little to widely for my perception. The recipients domain should be whitelistet (everyone in Domain.two).

HannesS
  • 322
  • 5
  • 17

1 Answers1

1

If you are Sender@Domain.one, you can do this. You can white-list e-mails towards Recipient@Domain.two and let the other ones get scanned. This is called white-listing a destination (outgoing ACL white-list).

If you are not Sender@Domain.one, you can't do what you state in the title. Filtering works for source (you) and destination (others), there is not way to interfere between 2 others.

If you are some kind of proxy, then you can white-list Sender@Domain.one on incoming and Recipient@Domain.two on outgoing and it should work.

Overmind
  • 2,970
  • 2
  • 15
  • 24
  • Sadly I am Admin@Domain.three - so I need to regulate mail flow from a third party to our customer. Since our server is a multi-domain mailserver, and forwards the messages to our customers exchange, I'd like to have the rule only for the third parties mails to our customer (and not anyone else - which is allowed by the workaround rule I set). Thanks for taking the time to answer - I already thought this will be not possible. If no other miracle answer turns up, I will mark yours as correct :-) – HannesS May 13 '19 at 12:46
  • If you are a proxy for the mail exchange between the two than see my updated answer. As a 3rd party server that is not proxy there's nothing you can do; the correct configurations can be done only on the target domain servers. – Overmind May 13 '19 at 13:01
  • Actually we have a single server that handles incoming mail and redirects it to the customers exchange (or postfix, whatever). So I believe our options are very limited - either whitelisting recipient domain and therefore killing all of spamassassins use with it, or living with whitelisting the third party messages for all our hosted domains. Thanks for elaborating! – HannesS May 13 '19 at 13:22