how to configure Gmail in postfix for sending emails1 min read

We need your support!!
Other Amount:
techrunnr.com:
24-Hour Flash Sale. Courses from just ₹ 490.
Prabhin Prabharkaran Administrator
DevOps Engineer

He is a Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!

follow me

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.

Prerequisites:

* 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

Configuration

Add the following lines in Postfix main.cf file.

 

vi /etc/postfix/main.cf

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

[smtp.gmail.com]:587 techrunnr.techrunnr@gmail.com:Passwordpls

NOTE: SMTP remains common for all Gmail.

Execute the following command to update the password to postfix.

Restart Postfix.

/etc/init.d/postfix restart

Now the emails sent from your system has from address as Gmail.

We need your support!!
Other Amount:
techrunnr.com:
#1
#2
#3
Questions Answered
Articles Written
Overall Points

Prabhin Prabharkaran

He is Technical professional. He is a person who loves to share tricks and tips on the Internet. He Posts what he does!!

You may also like...

Leave a Reply