IMAP diagnostics

IMAP AUTHENTICATIONFAILED: what it actually means

How it looks in the log
a1 NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)

The server received your username and password and refused. Note that this is not always a wrong password — the same code covers IMAP being switched off and the login being in the wrong format.

Causes, most likely first

How to fix it

  1. Create an app password in account security settings and paste it without spaces.
  2. Enable IMAP: Gmail → Settings → Forwarding and POP/IMAP; Yandex → Settings → Email clients.
  3. Check the login format against your provider guide — half of all cases are exactly this.
  4. For Microsoft 365 switch to OAuth 2.0; a tenant admin consents once.
  5. Test by hand: openssl s_client -connect imap.example.com:993 -crlf then a1 LOGIN user pass to see the raw server reply.

Test the connection in MoveMailbox

FAQ

Common questions

Why is a correct password rejected?

Providers return one code for three different situations: wrong password, IMAP disabled, and third-party access blocked. Check IMAP first — it is the most common cause.

How do I know an app password is needed?

If the password signs you into the web interface but fails over IMAP, you need a separate app password. Modern providers do not accept account passwords over IMAP.

Other errors

Find out how big your mailbox is. It costs nothing.

Connect two servers, look at the size and decide. Or take the client and keep everything on your side.

Code on GitHub · built on imapsync · no sign-up