If you are using Google Cloud, Then you are not able to send email directly using SMTP 25 port. So You can configure your Postfix  to send email via relay using SASL authentication. Simple Authentication and Security Layer (SASL) is a standard authentication framework supported by many services including Postfix. 
CASE A: I am using a VM on Google Cloud which is my Application server where multiple domain is hosted. I want to send email from specific domain using specific relay. You can use multiple relay for multiple domain. Another Domain will not able send email directly because GCP block SMTP 25 port for outgoing.Make sure the SASL authentication framework, and mailx are all installed
# yum -y install cyrus-sasl-plain mailx #Relay
smtp_sasl_security_options = noanonymous
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
header_size_limit = 4096000 @aaa.com                   smtp-relay.sendinblue.com:587 
@bbb.com                   smtp-relay.mailjet.com:587
@ccc.com                   smtp-relay.mailgun.com:587
smtp-relay.sendinblue.com:587   postmaster@aaa.com:3Ba4password0nrTg 
smtp-relay.mailjet.com:587      postmaster@bbb.com:3Ba4pass0nrTg
smtp-relay.mailgun.com:587      postmaster@ccc.com:Upass0nrTg
# postmap sasl_passwd sender_relay
# postfix reload # postqueue -f # chown root:postfix /etc/postfix/sasl_passwd*
# chmod 640 /etc/postfix/sasl_passwd*
OR 
# chmod 600 sasl_passwd
# chown root:root sasl_passwd Troubleshoot Delivery Issues
The maillog can be reviewed if the test message is not successfully delivered. Open another shell and run tail while performing another test. tail -f /var/log/maillog debug_peer_list=smtp-relay.rubel.com
debug_peer_level=3 systemctl reload postfix  # yum install cyrus-sasl cyrus-sasl-plain -y https://serversmtp.com/smart-host-smtp-relay-server-what-is-it/



Comments
Post a Comment
You are always welcome to comment here, but your remarks should be relevant to the conversation. To keep the exchanges focused and engaging, we reserve the right to remove off-topic comments, or self-promoting URLs and vacuous messages.
We will try to reply to your queries as soon as time allows.
Regards,
Admin