Changes

From Amahi Wiki
Jump to: navigation, search
no edit summary
Install postfix and remove sendmail: <br>
{{Code|sudo apt-get -y install postfix mailutilslibsasl2-2 ca-certificates libsasl2-modules
sudo apt-get -y remove sendmail}}
Execute the following to update /etc/postfix/main.cf:
{{Code|sudo postconf -e 'relayhost<nowiki>=</nowiki>gmail-[smtp-in.l.googlegmail.com]:587'
sudo postconf -e 'smtp_sasl_auth_enable<nowiki>=</nowiki>yes'
sudo postconf -e 'smtp_sasl_password_maps<nowiki>=</nowiki>hash:/etc/postfix/sasl_passwd'
sudo postconf -e 'smtp_sasl_security_options<nowiki>=</nowiki>noanonymous'sudo postconf -e 'smtp_tls_CAfile<nowiki>=</nowiki>/etc/postfix/cacert.pem'sudo postconf -e 'smtp_use_tls<nowiki>=</nowiki>yes'}}
Create '''/etc/postfix/sasl_passwd''' file with your Gmail login credentials that looks like below:
{{Text|Text=gmail-[smtp-in.l.googlegmail.com ]:587 user.name@gmail.com:password}}
Obviously, you need to change ''user'' to your username and ''password'' to your gmail password. <br>
{{Code|sudo chown root:root /etc/postfix/sasl_passwd
sudo chmod 600 /etc/postfix/sasl_passwd}}
 
Validating the certificate:
{{Code|cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem <nowiki>|</nowiki> sudo tee -a /etc/postfix/cacert.pem}}
Restart Postfix:
Reference: [http://ubuntulinuxyaui.co.inme/blog/ubuntu/set-up-postfix-for-relaying-emails-via-gmail-smtp-server Set Up -relay-ubuntu Postfix For Relaying Emails via gmail smtp + Gmail SMTP serverrelay in Ubuntu]
12,424

edits