# ERROR – 535 auth failure

**URL:** https://meta.discourse.org/t/error-535-auth-failure/273959
**Category:** Self-hosting
**Tags:** email
**Created:** [August 4, 2023, 12:51pm UTC](https://meta.discourse.org/t/error-535-auth-failure/273959 "2023-08-04T12:51:29Z")
**Posts on this page:** 1
**Showing post:** 10

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [September 11, 2023, 5:23pm UTC](https://meta.discourse.org/t/error-535-auth-failure/273959/10 "2023-09-11T17:23:58Z")

</div>

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:

```plaintext
○ → 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)

🚨 **DO NOT SHARE THIS STRING IT IS YOUR PLAINTEXT PASSWORD**

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

```plaintext
○ → 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.

---

_[View the full topic](https://meta.discourse.org/t/error-535-auth-failure/273959)._
