How to Configure Postfix Server on Centos

Postfix Server on Centos-6.4.
After Monitor tool for Servers Alert in Production and Staging. We need to send alert to all the Admin team and NOC team. Now, We need to Configure Postfix Mail Server. so that it can send mail to gmail or other mail server.

1. Installing Postfix {uninstall sendmail}
# yum install postfix -y

2. Configuring
Basically, you need to create a password file so that Postfix can authenticate to Gmail's servers. You do this by creating a file named sasl_passwd in /etc/postfix. Replace smtp_user and smtp_passwd with their respective values.

# echo "smtp.gmail.com: 587 shanub52@gmail.com:abc@123" > /etc/postfix/sasl_passwd
{ shanub52@gmail.com this ID sending a alert other domain, like gmail.com, yahoo.com }

3. You then hash that file so that the password is not stored in clear text. This command will create a file named sasl_passwd.db in the /etc/postfix/ directory. 
# postmap hash:/etc/postfix/sasl_passwd

4. After that is done, add these to the bottom of /etc/postfix/main.cf. This is assuming that your root certificates installed from openssl are located in /etc/pki/tls/certs/ca-bundle.crt.
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
# Secure channel TLS with exact nexthop name match.
smtp_tls_security_level = secure
smtp_tls_mandatory_protocols = TLSv1
smtp_tls_mandatory_ciphers = high
smtp_tls_secure_cert_match = nexthop
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
relayhost = smtp.gmail.com:587

5. After that is done, restart postfix :-
# service postfix restart
6. Test Postfix-realy :-

#echo "Test mail from postfix" | mail -s "Test Postfix" shanub52@gmail.com
#tail -f /var/log/maillog


How to Configure Postfix Server on Centos How to Configure Postfix Server on Centos Reviewed by Unknown on October 30, 2017 Rating: 5

Scribe

http://feeds.feedburner.com/LinuxAndAws
Powered by Blogger.
X

Get Updates On

Linux Tutorial

AWS Tutorial

Devops Tutorial

We are going to send you our resources for free. To collect your copy at first, join our mailing list. So don't miss any updates, stay connected!