how to configure Gmail in postfix for sending emails1 min read
how to configure Gmail in postfix for sending emails
Hi Techrunnr Subscribers, Today we will show you how to configure Gmail in postfix for sending emails. As the system generated emails are moved to spam folder so it’s better to configure valid email id for sending emails.
Here we are configuring Gmail to send emails from Linux machine.
* Make sure you have root access to the server
* Make sure that you install Postfix, if not install with the following command.
apt-get install postfix //Ubuntu/debian
yum install postfix //Centos/Redhat
Add the following lines in Postfix main.cf file.
relayhost = [smtp.gmail.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt
smtp_use_tls = yes
Create a new file /etc/postfix/sasl_passwd .Replace email id and password with yours
NOTE: SMTP remains common for all Gmail.
Execute the following command to update the password to postfix.
Now the emails sent from your system has from address as Gmail.