T
T
Tsarev Vadim2021-12-04 22:08:58
postfix
Tsarev Vadim, 2021-12-04 22:08:58

How to fix outgoing Postfix mail errors on Ubuntu 18.04 SASL authentication failed; server smtp.gmail.com?

How to fix outgoing Postfix mail errors on Ubuntu 18.04 SASL authentication failed; server smtp.gmail.com? I have been trying to cross with gmail for a whole day / I get
SASL authentication failed errors in the log; server smtp.gmail.com ...............
Did everything according to the instructions https://askubuntu.com/questions/1112772/send-syste...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Tsarev Vadim, 2021-12-05
@zava75

Answered myself
1) Turn on two-step authorization in your account and make the application in the application will have 12 password with spaces, put it without spaces in sasl_passwd
sudo chmod 400 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd
Lastly reload postifx:
sudo /etc /init.d/postfix reload
2) enable the debug log in main.cf
#debug_peer_list=smtp.gmail.com
#debug_peer_level=3
then comment it out. We look at the log var/log/mail.log

A
AlexVWill, 2021-12-04
@AlexVWill

Perhaps the Google account is connected with two-factor authentication, via SMS for example. Because of this, the connection fails.
Try enabling the less secure apps option

spoiler
STiYn.png

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question