Last active
July 16, 2018 18:33
-
-
Save farinspace/b047091be6dd0e3e0f06e86b1f303f68 to your computer and use it in GitHub Desktop.
MacOS X postfix relyhost mail setup
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
... | |
# append to /etc/postfix/main.cf | |
relayhost=smtp.sendgrid.net:587 | |
smtp_sasl_auth_enable=yes | |
smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd | |
smtp_sasl_security_options= | |
smtp_use_tls=yes | |
smtp_tls_security_level=encrypt | |
tls_random_source=dev:/dev/urandom |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Label</key> | |
<string>org.postfix.custom</string> | |
<key>Program</key> | |
<string>/usr/libexec/postfix/master</string> | |
<key>QueueDirectories</key> | |
<array> | |
<string>/var/spool/postfix/maildrop</string> | |
</array> | |
<key>AbandonProcessGroup</key> | |
<true/> | |
<key>OnDemand</key> | |
<true/> | |
<key>RunAtLoad</key> | |
<true/> | |
<key>KeepAlive</key> | |
<true/> | |
</dict> | |
</plist> |
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
smtp.sendgrid.net:587 [email]:[password] |
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
# create empty file | |
sudo touch /etc/postfix/sasl_passwd | |
# set permissions before entering credentials | |
sudo chmod go-rwx /etc/postfix/sasl_passwd | |
# setup credentials | |
sudi vi /etc/postfix/sasl_passwd | |
# create lookup table | |
sudo postmap /etc/postfix/sasl_passwd | |
# for extra security, remove file once lookup table is created | |
sudo rm /etc/postfix/sasl_passwd | |
# create a backup copy | |
sudo cp /etc/postfix/main.cf /etc/postfix/main.cf~orig | |
# append config | |
sudo vi /etc/postfix/main.cf | |
# create service config | |
sudo vi /Library/LaunchDaemons/org.postfix.custom.plist | |
# add mac os service service (be sure correct permissions are set; root:wheel) | |
sudo launchctl load /Library/LaunchDaemons/org.postfix.custom.plist | |
# restart macOS to confirm auto loading on boot | |
# confirm postfix process is running | |
ps -A | grep postfix |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tested macOS High Sierra 10.13.5