thanks all.  Looks like I can mostly do this with restriction classes,
though the drop ends up being a 5xx reject rather than a silent drop, which
is a bit too bad.

tester = check_recipient_access
hash:/etc/postfix/maps/privileged_recipients, *reject*

being able to use "discard" here would be great, but doesn't appear to be
possible

On Tue, 3 Dec 2019 at 17:38, Ralph Seichter <ab...@monksofcool.net> wrote:

> * Jonathan Engbrecht:
>
> > If From: f...@example.com
> > AND NOT To: (bar|baz|quux)@mydomain.com
> > DISCARD
>
> Milter-regex (https://www.benzedrine.ch/milter-regex.html) can do this,
> and more. The actual syntax for your example would be something like
> this (untested because I am typing from memory):
>
>   discard
>   header /^From$/ /foo@example\.com/ and not \
>   header /^To$/ /(bar|baz|quux)@mydomain\.com/
>
> You can also use variables in milter-regex to easily re-use complex
> expressions. I can heartily recommend it.
>
> -Ralph
>

Reply via email to