Viktor,

Thanks for the hint. The transport map seems do the trick...

/etc/postfix/main.cf
transport_maps = hash:/etc/postfix/transport

/etc/postfix/transport
mypartnerorg.com   :
mycompany.com      :
*                            error: 5.1.2 recipient domains not allowed

Thanks,
Steve

-----Original Message-----
From: owner-postfix-us...@postfix.org [mailto:owner-postfix-us...@postfix.org] 
On Behalf Of Viktor Dukhovni
Sent: Tuesday, February 17, 2015 10:48 AM
To: postfix-users@postfix.org
Subject: Re: smtpd_recipient_restrictions to restrict outbound email to 
selected domains

On Tue, Feb 17, 2015 at 06:35:11PM +0000, Steve Zeng wrote:

> > Via SMTP from outside, or via sendmail(1) locally?
>
> I run mail locally as below:
> mail -s "hotmail" myusern...@hotmail.com < /etc/hosts

Well, smtpd(8) restrictions don't apply to locally submitted email.

I generally configure the default Postfix instance (that handles local mail 
injection) as a null client (as in MULTI_INSTANCE_README) and that makes it 
possible to use transport_mapa, and/or default_transport to control which 
destinations are reachable by adding "error:5.1.2 ..." transport overrides.

The network-facing MTA runs as a separate Postfix instance, in which local 
submission is restricted:

    authorized_submit_users = root, postfix

--
        Viktor.
NOTICE: This email message is for the sole use of the addressee named above and 
may contain confidential information.
Any unauthorized review, use, disclosure, distribution or duplication of this 
message or any attachments is expressly prohibited.
If you are not the intended recipient, please contact the sender by reply email 
and destroy all copies and backups of the original message.

Reply via email to