Skip to content

Instantly share code, notes, and snippets.

@kany
Last active June 3, 2024 20:13
Show Gist options
  • Save kany/c44c077881047ead8faa to your computer and use it in GitHub Desktop.
Save kany/c44c077881047ead8faa to your computer and use it in GitHub Desktop.
Setup SENDMAIL on Mac OSX Yosemite

SENDMAIL on MAC OSX Yosemite

  1. Create a file to store our credentials:
sudo vim /etc/postfix/sasl_passwd
  1. Add something like this:
smtp.gmail.com:587 username@gmail.com:password
  1. Now run:
sudo postmap /etc/postfix/sasl_passwd
  1. Prepare the postfix main config file:
sudo vim /etc/postfix/main.cf
  1. Add/update these lines
    relayhost=smtp.gmail.com:587
    smtp_sasl_auth_enable=yes
    smtp_sasl_password_maps=hash:/etc/postfix/sasl_passwd
    smtp_use_tls=yes
    smtp_tls_security_level=encrypt
    tls_random_source=dev:/dev/urandom
    smtp_sasl_security_options = noanonymous
    smtp_always_send_ehlo = yes
    smtp_sasl_mechanism_filter = plain
  1. Stop/Start the service
sudo postfix stop && sudo postfix start
  1. Check the queue for any errors
mailq
@TonReurts
Copy link

TonReurts commented Nov 28, 2022

After this setup I get the following error:
-Queue ID- --Size-- ----Arrival Time---- -Sender/Recipient-------
0B3D68C4939 1669 Mon Nov 28 11:31:59 imac2019@iMac-di-iMac.fritz.box
(Temporary lookup error)
ton@reurts.com
What setting have I done wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment