ERROR – 535 auth failure

AI-generated summary

The discussion revolves around a persistent 535 auth failure error in Discourse when sending emails via SMTP. slajar reports the issue despite verifying credentials, testing with other email clients, and updating to the latest version. Lilly suggests checking the troubleshooting guide, but the problem remains. JammyDodger recommends reviewing the app.yml credentials, while slajar asks about enabling debug output. supermathie explains that the error indicates authentication failure and suggests testing SMTP manually using Python to generate the AUTH PLAIN base64 string and verify credentials. They note that 2FA/MFA could interfere and advise checking the password, as tikidave found that special characters in the password caused issues and a reset to alphanumeric-only worked.

Basically, I am facing the same issue as described here: https://meta.discourse.org/t/job-exception-535-authentication-failed/172537

For some reason our E-Mail outbound does not work anymore and I get now an error 535. I rechecked the E-Mail account. I can login there and use it from Apple Mail. SMTP Mail sending I also tested with Apple Mail. But discourse gives me this error message “ERROR – 535 auth failure”. I am not sure, how to proceed here. Is SMTP still supported?

My tests until now:

  1. I tried different Mail Accounts
  2. I tested the Mail Accounts with another Mail Software
  3. I updated to the latest discourse version. (3.2.0.beta1-dev)

Any help would be appreciated.

maybe have a look here?

Yes, I did. But the error preserves.

Is there anything else, we could try? Any help would be appreciated.

Do you have a copy of the error with more detail in?

From a search, you could try checking and re-entering your credentials in your app.yml.

Unfortunately, I don’t know how to retrieve more detail here. Is there any option to enable more debug information in that case? On the command line there is no context. The error appears in the UI.

Isn’t there something like verbose debugging output?

What other information would help? The remote server is telling you authentication failed. There’s not a lot more we can say.

Do you have 2FA or MFA turned on for this mail account? This might prevent SMTP AUTH from working.

If not, can you try SMTP by hand to see if the authentication works?

You need to first construct the authentication string (a base64-encoded string of username␀username␀password)

I suggest using python:

○ → ipython3

In [1]: import base64

In [2]: import getpass

In [3]: u, p = 'michael', getpass.getpass()
Password: (paste or type password here)

In [4]: base64.b64encode(f'{u}\x00{u}\x00{p}'.encode()).decode()
Out[4]: 'bWlxxxxxxxxxxxxxxxxxxxxxxxxxxx'

(please change michael to your actual SMTP username if you do this)

:rotating_light: DO NOT SHARE THIS STRING IT IS YOUR PLAINTEXT PASSWORD

and then doing SMTP by hand, e.g.:

○ → openssl s_client -starttls smtp -connect mail.my.domain:587
CONNECTED(00000003)
…
---
250 SMTPUTF8
AUTH PLAIN bWljaGFlbABtaWNoYWVsAHBhc3N3b3Jk ← the password "password"
535 5.7.8 Error: authentication failed: authentication failure
AUTH PLAIN bWlxxxxxxxxxxxxxxxxxxxxxxxxxxx ← the real password
235 2.7.0 Authentication successful
RSET
250 2.0.0 Ok
QUIT
221 2.0.0 Bye
closed

If that doesn’t work, the credentials probably really are bad. If it does work… we’ll look further.

In my case, it did not like my password and I needed to reset it to something alphanumeric (no special chars).