I just setup email sending on my server by following this clear tutorial.
The tutorial walked me through setting up Postfix on an Ubuntu server and sending email via Gmail’s SMTP. I had to create a certificate, sign it, have my server communicate via some secure transport layer with Gmail using another certificate signed by some country in South Africa. I don’t understand all of it, but it works.
If you have WordPress installed like me, you can test Postfix is working by asking for a password reset on the wp-admin screen. You should get an email right away.
If you notice this error in your mail log:
localhost postfix/smtp: certificate verification failed for aspmx.l.google.com[22.214.171.124]:25: untrusted issuer /C=US/O=Equifax/OU=Equifax Secure Certificate Authority
You can fix that by following this blog post. But I wouldn’t recommend copying the digital
certificates on that site (or any site for that matter). Copy/paste the appropriate certificates
stored in your server. If you’re using Ubuntu, they can be found in
If you notice this error:
localhost postfix/tlsmgr: warning: request to update table btree:/var/run/smtpd_tls_session_cache in non-postfix directory /var/run localhost postfix/tlsmgr: warning: redirecting the request to postfix-owned data_directory /var/lib/postfix localhost postfix/tlsmgr: warning: request to update table btree:/var/run/smtp_tls_session_cache in non-postfix directory /var/run localhost postfix/tlsmgr: warning: redirecting the request to postfix-owned data_directory /var/lib/postfix
Replace those two instances of
/var/run in the Postfix main.cf with