I put this together for myself a long time ago, give it a try and see if it still works.
In a terminal window, type:
sudo aptitude install postfix libsasl2 ca-certificates mailx
sudo gedit /etc/postfix/main.cf
then add/change this in main.cf
:
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
append_dot_mydomain = no
readme_directory = no
relayhost = [smtp.gmail.com]:587
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_note_starttls_offer = yes
tls_random_source = dev:/dev/urandom
smtp_tls_scert_verifydepth = 5
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
smtp_tls_CAfile = /etc/postfix/cacert.pem
smtpd_use_tls=yes
smtp_use_tls = yes
smtpd_tls_ask_ccert = yes
smtpd_tls_req_ccert =no
smtp_tls_enforce_peername = no
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
edit the /etc/postfix/sasl_passwd
to setup your username and password:
sudo gedit /etc/postfix/sasl_passwd
[smtp.gmail.com]:587 user.name@gmail.com:password
Then do:
sudo chmod 400 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd
cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem
sudo /etc/init.d/postfix restart
thanks for cleaning that up. I am still trying to figure out all the editing quirks for the answer window. – d4v3y0rk – 2012-09-11T15:46:39.400