sudo vim /etc/postfix/sasl_passwd
smtp.gmail.com:587 [email protected]:password
sudo postmap /etc/postfix/sasl_passwd
sudo vim /etc/postfix/main.cf
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
Check postfix status:
sudo postfix status
-
If postfix is not running, start the service:
postfix/postfix-script: the Postfix mail system is not running
sudo postfix start
postfix/postfix-script: starting the Postfix mail system
-
If postfix is running, reload the service:
postfix/postfix-script: the Postfix mail system is running: PID: XXXX
sudo postfix reload
postfix/postfix-script: refreshing the Postfix mail system
date | mail -s testing [email protected]
mailq
- To clear the mail queue:
sudo postsuper -d ALL
- If you receive a message like
(TLS is required, but our TLS engine is unavailable)
enable tls:sudo postfix tls enable-client
In Gmail we must switch on the option “Access for less secure apps“, otherwise we will get the error: SASL authentication failed https://support.google.com/mail/answer/7126229?p=BadCredentials&rd=2#cantsignin
macOS Sierra 10.12.6
Sill getting Error
(TLS is required, but our TLS engine is unavailable)
after running commandsudo postfix tls enable-client
PLEASE HELP!!!!!!