In this video I have expained about How to Install and Configure Postfix to Send Mail Using Gmail and Google Apps on Ubuntu
Installation and Configuration Steps:
hostnamectl set-hostname mail.krishnastechinfo.com
apt-get install libsasl2-modules postfix
nano /etc/postfix/sasl/sasl_passwd
[smtp.gmail.com]:587 [email protected]:password
postmap /etc/postfix/sasl/sasl_passwd
chown root:root /etc/postfix/sasl/sasl_passwd /etc/postfix/sasl/sasl_passwd.db
chmod 0600 /etc/postfix/sasl/sasl_passwd /etc/postfix/sasl/sasl_passwd.db
nano /etc/postfix/main.cf
relayhost = [smtp.gmail.com]:587
Enable SASL authentication
smtp_sasl_auth_enable = yes
Disallow methods that allow anonymous authentication
smtp_sasl_security_options = noanonymous
Location of sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
Enable STARTTLS encryption
smtp_tls_security_level = encrypt
Location of CA certificates
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
systemctl restart postfix
echo "Postfix" | mail -s "Postfix Testing" [email protected]