Last Updated: February 25, 2016
·
3.297K
· groodt

Relay outbound email through GMail on OSX Mavericks

  • Edit /etc/postfix/main.cf
################################
# GMail relay
###############################

# sets gmail as relay
relayhost = [smtp.gmail.com]:587

#  use tls
smtp_use_tls = yes

# use sasl when authenticating to foreign SMTP servers
smtp_sasl_auth_enable = yes

# path to password map file
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd

# eliminates default security options which are imcompatible with gmail
smtp_sasl_security_options =

smtp_tls_session_cache_database = btree:$data_directory/smtp_tls_session_cache
  • Create and edit /etc/postfix/sasl_passwd (Create an app specific password if you use Google 2-factor authentication for GMail)
[smtp.gmail.com]:587  username:password
  • Generate sasl_passwd files
sudo postmap /etc/postfix/sasl_passwd
  • Reload Postfix
sudo postfix reload
  • Send test email to yourself
date | mail -s testing your@email.com
  • Debug
tail -f /var/log/mail.log