1-Sir first we need to Install the required packages on ubuntu
sudo aptitude install postfix libsasl2 ca-certificate libsasl2-modules
2-Configure Postfix on your server
3-Use the Tab key to highlight <OK> and then press Enter
4-choose Internet Site.
5-Here you need to replace mail.example.com with the valid address of your mailserver.
6-You’ll want to add the following lines to your /etc/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/postfix/cacert.pem
smtp_use_tls = yes
7-Define Username and Password
Create the file /etc/postfix/sasl_passwd having following contents:
[smtp.gmail.com]:587 youremail@gmail.com:mypasswo
8-This file should have restrictive permissions so that Postfix will read.
sudo chmod 400 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd
>>>>>>>Now restart Postfix and it should work for you<<<<<<<<
No comments:
Post a Comment