krmnn
5/16/2017 - 11:25 AM

Make MacOS send mail over relay via built-in postfix

Make MacOS send mail over relay via built-in postfix

$relayhost:$port $user@$relayhost:$password
user@localhost user@relayhost
relayhost = $relayhost:$port

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/smtp_sasl_passwords
smtp_sasl_security_options = noanonymous

smtp_use_tls=yes
smtp_sasl_mechanism_filter = plain
smtp_tls_security_level = encrypt
smtp_tls_loglevel = 2

smtp_generic_maps = hash:/etc/postfix/smtp_generic

Make MacOS send mail over relay via built-in postfix

tested with MacOS 10.12.4

  1. Make additions to the end of /etc/postfix/main.cf, see below.
  2. Create /etc/postfix/smtp_sasl_passwords and smtp_generic, see below.
  3. Secure file permissions: chmod 0640 /etc/postfix/smtp_sasl_passwords
  4. Update hashmaps: cd /etc/postfix && postmap smtp_sasl_passwords && postmap smtp_generic
  5. Reload postfix configuration: postfix reload

Test:

% date | mail -s "the date" my@receipient.com

% date | sendmail -f user@relayhost my@receipient.com