Access

App passwords: why you need one and where to get it

Almost every migration starts with the same stumble. You type the password you just used to sign in to the web interface, and the server refuses it. The password is correct. It is simply not meant for IMAP.

Why your normal password is refused

A webmail login can ask for a second factor: a code from an app, an SMS, a tap on your phone. IMAP cannot. The protocol has exactly one LOGIN command carrying a username and a password, and there is nowhere in it for a second step.

Providers all solved this the same way. The account password stopped being accepted over IMAP at all, and external clients get a separate one instead: an app password. It is a long random string that works only for mail protocols, cannot sign you in to the web interface, and can be revoked with one click without touching your real password.

That leads to a practical point worth keeping: handing a migration tool an app password is safer than handing it your account password. Even if it leaks, nobody can enter the account, change the password, or read your files.

Where each provider keeps it

The section has a different name everywhere, but it always lives in account security settings, never in mail settings. Providers move the exact wording around, so follow the meaning rather than a literal path.

What it looks like and how to type it

Gmail shows the password as four groups of four characters. The spaces are presentation, not part of the secret: what you paste is sixteen characters with nothing between them. This is behind roughly every third authentication failure we see on Gmail migrations.

The password is shown exactly once. Losing it costs nothing — revoke the old one, issue a new one in half a minute, and the mailbox itself is untouched.

The username stays what it was: the full address. One exception is worth remembering — on Yandex, a mailbox on a custom domain often expects only the part before the at sign, and signing in with the full address fails exactly like a wrong password would.

What the wrong format looks like in the log
a1 LOGIN "user@example.com" "abcd efgh ijkl mnop"
a1 NO [AUTHENTICATIONFAILED] Invalid credentials (Failure)

When the app password section is missing

Three reasons, most common first, and what to do about each.

  1. Two-factor authentication is off. Google and Apple only reveal the section after it is enabled; turn it on and reload the page.
  2. A tenant administrator has blocked legacy authentication. Then no app password exists at all, and you need OAuth or a temporary exception from the administrator.
  3. The provider has no such mechanism: it accepts the account password but wants IMAP enabled separately. Check mail settings — it is usually a single switch.

What to do with it afterwards

Revoke it. An app password is issued for one job, and once the mail has moved and the counters match, neither you nor we need it any more.

Revoking happens in the same place it was issued and closes IMAP access immediately, leaving your account password and your browser sessions alone.

FAQ

Common questions

Is an app password different from my mailbox password?

Yes. The account password opens the web interface and the whole account; an app password works only over mail protocols and is revoked on its own.

How many app passwords can I create?

Most providers allow dozens. One per mailbox is enough for a migration, and a fresh one beats reusing the password your phone client already has.

Is it safe to give a migration service an app password?

Safer than giving it the account password: it cannot sign in to the account or change the password. Revoke it after the migration and access is closed completely.

The server still answers AUTHENTICATIONFAILED with an app password

Check three things: the spaces are gone, IMAP is enabled in mail settings, and the username is in the format the provider expects. There is a full write-up of that error.

Where to next

Move your mail with MoveMailbox

More posts

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