I have a few postfix servers that I use to send email from webforms, I want to be able to send email from external domains to my domains, from my domains to my domains, and from my domains to external domains.
I do NOT want to be able to send from external domains to external domains.
mynetworks alone seems to make a full open-relay (from any to any), which I do NOT want.
internal domains = example.com,example.org external domain = yahoo.com
From internal to any = Allow
Desired Result:
mail from: [email protected] < 2.1.0 OK
rcpt to: [email protected] < 2.1.5 OK
rcpt to: [email protected] < 2.1.5 OK
rcpt to: [email protected] < 2.1.5 OK
Actual Result:
rcpt to: [email protected] < 2.1.5 OK
rcpt to: [email protected] < 2.1.5 OK
rcpt to: [email protected] < 454 4.7.1 Relay Access Denied
From Any to Internal Only
Desired Result:
mail from: [email protected] < 2.1.0 OK
rcpt to: [email protected] < 2.1.5 OK
rcpt to: [email protected] < 2.1.5 OK
rcpt to: [email protected] < 454 4.7.1 Relay Access Denied
Actual Result:
mail from: [email protected] < 2.1.0 OK
rcpt to: [email protected] < 2.1.5 OK
rcpt to: [email protected] < 2.1.5 OK
rcpt to: [email protected] < 454 4.7.1 Relay Access Denied
As I was going though every scenario I figured it out!
/etc/postfix/main.cf
/etc/postfix/sender_access