Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

This is what I did..

sudo apt-get install postfix

This is my /etc/postfix/

# See /usr/share/postfix/ for a commented, more complete version

# Debian specific:  Specifying a file name will cause the first
# line of that file to be used as the name.  The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

readme_directory = no

# TLS parameters
smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache

myhostname =

alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases

myorigin = /etc/mailname
mydestination =
relayhost = []:587
mynetworks = [::ffff:]/104 [::1]/128
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
default_transport = smtp
relay_transport = smtp
inet_protocols = all

# SASL Settings
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_CAfile = /etc/postfix/cacert.pem

Then I created the file /etc/mailname with my hostname as content:

Then I created the file /etc/postfix/sasl_passwd:


Then sudo postmap /etc/postfix/sasl/passwd

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

service postfix restart

Still sends nothing... I'm on Ubuntu Server 12.04.

share|improve this question
What is it you're actually trying to do? It's really not clear. – growse Jun 2 '12 at 20:28
up vote 1 down vote accepted

Consult your /var/log/mail.log for details.

Your config seems to be correct and actually works as for satellite site config for postfix on Ubuntu 12.04.

share|improve this answer

It's not really a one-liner to configure postfix for gmail, so I made a configuration script that does the whole process automatically. The script will ask you for your gmail username and password, and configure everything else automatically.

Check it out here.

I suggest you to purge (delete) all existing postfix configuration before running the script. You can do this by running:

sudo apt-get purge -y postfix

share|improve this answer

Maybe you're using the wrong certificate? I don't actually know anything about Postfix configuration, but according to this 2009 tutorial, you should be using this instead of the Thawte cert:

sudo cat /etc/ssl/certs/Equifax_Secure_CA.pem >> /etc/ssl/certs/cacert.pem

(The latter folder structure may need to be tweaked, as it looks different from yours.)

There's also another tutorial here that may help. Good luck.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.