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
tested with MacOS 10.12.4
/etc/postfix/main.cf
, see below./etc/postfix/smtp_sasl_passwords
and smtp_generic
, see below.chmod 0640 /etc/postfix/smtp_sasl_passwords
cd /etc/postfix && postmap smtp_sasl_passwords && postmap smtp_generic
postfix reload
% date | mail -s "the date" my@receipient.com
% date | sendmail -f user@relayhost my@receipient.com