Q: Postfix block open relay mail from mynetworks we're running postfix 3.1.4.  Found that some hosts in mynetworks may use our server as open relay, to send mail with sender@ and recipient@ where domainA and domainB are not local domains.  
It's acceptable to have either sender or recipient on non-local domains but not both.   
Would anyone please help?    Thanks a lot.
Regards,
/ST Wong

A: You can limit relay only for certain domains, for example
smtpd_relay_restrictions = check_sender_access hash:/etc/postfix/permit_domain, defer_unauth_destination

permit only domains listed in file, file format is
mydomain.com OK
anotherdomain.com OK

