I’m using mailcow-dockerized to send emails (verification emails and welcome emails)
I have many domains setup with mailboxes for each
I want that all emails sent from [email protected], and [email protected] to be relayed to google workspace smtp relay if the recipient email is not any of these : @gmail.com, @hotmail.com, @outlook.com, @icloud.com
My postfix configuration files:
cd /opt/mailcow-dockerized
###file data/conf/postfix/extra.cf:
relayhost =
transport_maps = hash:/opt/postfix/conf/transport
sender_dependent_relayhost_maps = hash:/opt/postfix/conf/sender_relay
smtp_use_tls=yes
smtp_tls_security_level=encrypt
smtp_sasl_auth_enable=yes
smtp_sasl_password_maps=hash:/opt/postfix/conf/sasl_passwd
smtp_sasl_security_options=noanonymous
smtp_helo_name=maildomain.com
###file data/conf/postfix/transport:
google.com smtp:
hotmail.com smtp:
outlook.com smtp:
icloud.com smtp:
gmail.com smtp:
apple.me smtp:
###File data/conf/postfix/sasl_passwd
smtp-relay.gmail.com]:587 [email protected]:apppassword1
[smtp-relay.gmail.com-support]:587 [email protected]:apppassword2
###File data/conf/postfix/sender_relay:
[email protected] [smtp-relay.gmail.com]:587
[email protected] [smtp-relay.gmail.com]:587
Of course I had run postmap transport sasl_paswd sender_relay
The problem I’m facing is it’s still relaying emails going to @gmail.com, @hotmail.com, @outlook.com, @icloud.com
The reason I want to only relay emails going to other email domains is I already have a great email delivery on the mentioned domains, and I don’t want my daily quota to finish soon.