On 10/27/2016 10:17 PM, Mohamed Lrhazi wrote: > Been a long time since I used Postfix, sorry for this basic question. > > I have a Postfix server used internally by servers in the network to > send out mail. Itself relays all mail to an upstream server. > > How can I reject mail from given clients (list of IPs), but only if > destined for domains other than a given list of domains. > > am confused by the fact that for my Postfix, all mail is "relay" > mail... and no domains are defined as "local"... so I can just say > restrict relaying to this list of clients. > > Thanks a lot, > Mohamed. >
use a restriction class. First check_client_access to see if it's a restricted IP, then a check_recipient_access to see if it's an allowed destination, then a final reject for anything not allowed. Docs and some similar examples are here: http://www.postfix.org/RESTRICTION_CLASS_README.html -- Noel Jones