Created
January 16, 2012 01:42
-
-
Save yanaga/1618526 to your computer and use it in GitHub Desktop.
Postfix relaying to gmail on Ubuntu 10.04 LTS HOWTO
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install postfix libsasl2-2 ca-certificates libsasl2-modules | |
cat << EOF | sudo tee /etc/postfix/main.cf | |
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu) | |
biff = no | |
append_dot_mydomain = no | |
readme_directory = no | |
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem | |
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key | |
smtpd_use_tls=yes | |
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache | |
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache | |
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 | |
myorigin = /etc/mailname | |
mydestination = localhost | |
mynetworks = 127.0.0.0/8 | |
mailbox_size_limit = 0 | |
recipient_delimiter = + | |
inet_interfaces = loopback-only | |
inet_protocols = ipv4 | |
EOF | |
cat << EOF | sudo tee /etc/postfix/sasl_passwd | |
[smtp.gmail.com]:587 user.name@gmail.com:password | |
EOF | |
sudo chmod 400 /etc/postfix/sasl_passwd | |
sudo postmap /etc/postfix/sasl_passwd | |
sudo service postfix restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment