user1245262
user1245262

Reputation: 7505

How to avoid WantAuthError with sendmail

I'm trying to create a cron job that will periodically email me. To do this, I am trying to learn how to use sendmail.

I have created the following files in /etc/ssmtp

revaliases:

# sSMTP aliases
# 
# Format:       local_account:outgoing_address:mailhub
#
# Example: root:[email protected]:mailhub.your.domain[:port]
# where [:port] is an optional port number that defaults to 25.

root:[email protected]:smtp.gmail.com:587

and

ssmtp.conf

UseSTARTTLS=YES
[email protected]
mailhub=smtp.gmail.com:587
AuthUser="Jonathan Smythe"
AuthPass=my,password?

I've enabled POP and IMAP in my gmail account and also told it to allow less secure apps. However, when I try to send a test email from the command line, I get the following errors:

ubuntu@ip-172-31-30-193:~$ echo "hello" | sudo sendmail [email protected]
sendmail: Authorization failed (535 5.7.8  https://support.google.com/mail/?p=BadCredentials c202sm20828558qkb.19 - gsmtp)

I've tested the password, and it is accurate - at least I can log in and out repeatedly without problems.

What else do I need to do, or haven't I done?

Upvotes: 1

Views: 282

Answers (0)

Related Questions