Postfix should already be enabled to deliver email on your Mojave out of the box. You can test if its working by simply using the command line mail command:
mail [email protected]
Subject: test subject
test
.
One problem could be that the default outgoing mail port is being firewalled by your ISP.
Try running the above mail command in one terminal window while streaming the logs as suggested by anotherlatenight, in another. That should give you an idea what is failing.
--
However, if you want to relay through another host, GMAIL for example:
add
[smtp.gmail.com]:587 [email protected]:password
to /etc/postfix/sasl_password. (you will need to use sudo) obviously replacing username and password...
Then
sudo postmap /etc/postfix/sasl_password
Then make sure the following are in your /etc/postfix/main.cf (from http://www.postfix.org/SASL_README.html#client_sasl)
relayhost=[smtp.gmail.com]:587
# Enable SASL authentication in the Postfix SMTP client.
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noplaintext, noanonymous
smtp_sasl_tls_security_options = noanonymous
smtp_tls_security_level = encrypt
smtp_sasl_mechanism_filter = AUTH LOGIN
smtp_use_tls = yes
smtp_tls_security_level = encrypt
You do not need to start postfix unless you want your Mac to be a mail server.