STEPS : POSTFIX CONFIGURATION
1. Install Mail Packages
yum install postfix mailx cyrus-sasl cyrus-sasl-plain -y
2. Create GMail Account
a) Generate App Password
3. Edit sasl_password file and add gmail account details
vi /etc/postfix/sasl_passwd
[smtp.gmail.com]:587 <emailid>@gmail.com:**********
4. Generate DB file
postmap /etc/postfix/sasl_passwd
5. Edit main.cf
relayhost = [smtp.gmail.com]:587
myhostname = oracle-vm.com
# Enable SASL authentication for postfix
smtp_use_tls = yes
smtp_sasl_auth_enable = yes
smtp_tls_security_level = encrypt
smtp_tls_CAfile = /etc/ssl/certs/ca-bundle.crt
# Disallow methods that allow anonymous authentication
smtp_sasl_security_options = noanonymous
# Location of sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
6. Test EMAIL
echo "Test Email" | mail -s "Send Email from Linux" sendmail@gmail.com
Comments