Monday, June 22, 2020

Postfix- Relayhost with plain auth

If you wish to relay mails through your isp smtp server or any other, which requires plain/any auth, following config will help you.
Assuming that you have fresh postfix installed.

Install Dependency
yum install cyrus-sasl-plain -y

Postfix Configuration
add below lines in /etc/postfix/main.cf
relayhost = RELAY_SMTP_SERVER:PORT
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options =
myorigin = MY-MAIL-SERVER


Enable Smtp Auth for relayhost
cat /etc/postfix/sasl_passwd
RELAY_SMTP_SERVER EMAIL_ADDRESS:PASSWORD



postmap /etc/postfix/sasl_passwd
service postfix reload

No comments:

Post a Comment