0% found this document useful (0 votes)
173 views2 pages

Configure Postfix To Use Gmail SMTP On Ubuntu

The document discusses configuring Postfix on Ubuntu to use Gmail SMTP for sending emails. It provides steps to install Postfix, configure the main.cf file and sasl_passwd file with Gmail credentials, and reload Postfix. However, when testing an email is sent it does not work, and the solution provided is to validate certificates by adding a certificate file to the Postfix configuration and reloading Postfix.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
173 views2 pages

Configure Postfix To Use Gmail SMTP On Ubuntu

The document discusses configuring Postfix on Ubuntu to use Gmail SMTP for sending emails. It provides steps to install Postfix, configure the main.cf file and sasl_passwd file with Gmail credentials, and reload Postfix. However, when testing an email is sent it does not work, and the solution provided is to validate certificates by adding a certificate file to the Postfix configuration and reloading Postfix.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Configure Postfix to Use Gmail SMTP on Ubuntu

Ref:
https://stackoverflow.com/questions/48733960/configure-postfix-to-use-gmail-smtp-on-ubuntu

Ask Question

10
I'm using ​this online guide here​ to enable simple mail sending from linux (ubuntu) terminal
with postfix through some gmail account. I've done the steps listed there:

sudo apt-get install postfix mailutils libsasl2-2 ca-certificates


libsasl2-modules vim /etc/postfix/main.cf

And add these lines:

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/postfix/cacert.pem smtp_use_tls = yes

Then edit this file:

vim /etc/postfix/sasl_passwd

To add the lines like it says in the guide:

[smtp.gmail.com]:587 [email protected]:PASSWORD

(Of course with my own mail and password) then finally:

sudo chmod 400 /etc/postfix/sasl_passwd sudo postmap /etc/postfix/sasl_passwd

And then:

sudo /etc/init.d/postfix reload


When I try to send a simple mail nothing happens:

echo "Test mail from postfix" | mail -s "Test Postfix" [email protected]

(Of course here too with some other valid email)

What am I doing wrong? Thanks!

I think you need validate certificates to avoid running into error.

Try with:

cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a


/etc/postfix/cacert.pem

If you run into issues with above command, try rename the certificate
to:​thawte_Primary_Root_CA.pem​ in above command.

And now, reaload the server

sudo /etc/init.d/postfix reload

● Yes it works!! I've used: thawte_Primary_Root_CA.pem ... Thanks a lot! – ​OrenIshShalom​ ​Mar 24
'18 at 18:10

You might also like