Skip to content

Instantly share code, notes, and snippets.

@delputnam
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save delputnam/71b11fb750310f3e57b3 to your computer and use it in GitHub Desktop.
Save delputnam/71b11fb750310f3e57b3 to your computer and use it in GitHub Desktop.
Set up postfix (on Mac OS X 10.10 Yosemite) with Google Apps smtp
$ sudo vim /etc/postfix/main.cf
Add the following to the 'relayhost' section:
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_use_tls = yes
smtp_sasl_mechanism_filter = plain
$ sudo vi /etc/postfix/sasl_passwd
Add the following line:
[smtp.gmail.com]:587 yourusername@domain.com:yourpassword
$ sudo chmod 600 /etc/postfix/sasl_passwd
$ sudo postmap /etc/postfix/sasl_passwd
$ sudo launchctl stop org.postfix.master
$ sudo launchctl start org.postfix.master
Then test with something like:
$ mail -s "This is a test" username@domain.com <<EOF
> This is just a test.
> EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment