On 12/3/2019 3:31 PM, Jonathan Engbrecht wrote:
Can I make a header_check rule (or equivalent) somehow that does the following:

If From: f...@example.com <mailto:f...@example.com>
AND NOT To: (bar|baz|quux)@mydomain.com <http://mydomain.com>
DISCARD


header_checks operates on each single header, you can't compare info from different headers. So no.

You can use restriction classes or a policy service such as postfwd to compare both the sender and recipient, but keep in mind those features use the envelope sender and recipient and not what's listed in the From: and To: headers.
http://www.postfix.org/RESTRICTION_CLASS_README.html
http://postfwd.org/

You could do this in a milter or a content_filter.



  -- Noel Jones

Reply via email to