Florin Andrei:
> Okay, let's try this:
> 
> The goal is to send most emails to local, send most mydomain.com 
> recipients to a relay nearby, and let foobardomain.com senders go out on 
> the Internet freely.

Presumably, if foobardomain.com senders send mail to local or
mydomain.com recipients, then that mail should also not go to the
Internet.

In that case, set sender_dependent_default_transport_maps so that
all senders resolve to the error transport except for a few.

/etc/postfix/main.cf:
    # Override default_transport NOT transport_maps.
    sender_dependent_default_transport_maps = pcre:/etc/postfix/sender_pcre

/etc/postfix/sender_pcre:
    if !/@foobardomain\.com$/
    /./ error:5.7.1 Sorry, you can't send mail to that destination
    endif

Then specify explicit transport:nexthop entries for local and
mydomain.com mail using main.cf:transport_maps.

This is all from memory.

        Wietse

Reply via email to