29

I am using the Mail app on Mac OS X to access my Gmail account using 2-factor authentication. The app is configured with an application-specific password and it works fine for a few days: email can be sent and received without a problem. But then I get this error message:

The SMTP server "smtp.gmail.com" rejected the password for user "[email protected]"

From this point on no emails can be sent, although I still get incoming messages via IMAP.

If I revoke the app-specific password, generate a new one, and enter it in the app, it fixes the problem for a few days. Then I get this error again and must enter a new password. This has been going on for months.

Before I turned on 2-factor authentication, everything worked smoothly.

I also have Gmail configured on my iPhone with a different app-specific password, and there this problem does not occur.

3
  • This questions looks like a duplicate of this one: apple.stackexchange.com/questions/53885/…. You may want to check that out. Commented Sep 28, 2012 at 10:31
  • this is a very interesting question, perhaps wrong stachexchange site, but damn interesting!
    – Randy L
    Commented May 11, 2014 at 4:22
  • Doesn't work. Input 2fa password both with and without username and I am unable to send. Note that I am using "Other" rather than "Google" when setting up on Iphone 5 (latest version as of today).
    – lobi
    Commented Dec 2, 2015 at 16:32

5 Answers 5

16

The application-password that you create will need to be added in two places in your Apple Mail app.

There is your Incoming Mail Server password, which is immediately visible under your account information.

Below that you can see the selection for Outgoing Mail Server (SMTP). The default will be Gmail. Click on the drop down box and select "Edit Server List".

Here you will discover that you actually need to enter that application-password a second time. Put it in here and you're done.

The other reference to application-passwords expiring is incorrect. ONE-TIME passwords do. If you use the regular application passwords you would log in to your account settings and revoke them when no longer needed.

2
  • Thanks. I am aware of this, and I added the password both for both incoming and outgoing mail. I know I added them correctly, because for a while I was able to send and receive emails (I updated the question to reflect this). The problem is that after a while, and without my changing any of the settings, sending email stopped working. I could still receive email. I understand this is a difficult problem to solve; I was just hoping that someone else also ran into it. Commented Sep 27, 2012 at 15:44
  • This has been killing me since I went to two factor auth in Gmail...thank you!!
    – cscott530
    Commented May 12, 2013 at 3:40
5

I ran into this problem as well, and after a while determined it's related to the Keychain Access where the passwords are stored.

One forum I found suggested running a "Repair" of the login keychain (available via the "First Aid" menu item), which resolved the problem for some people. For me, however, the repair process found nothing to fix.

Finally, I went through the following steps which resolved the issue for me:

  1. Close Mail & iCal
  2. Open "System Preferences"->"Mail, Contacts & Calendars", find the Google/Gmail account, and uncheck both Mail & Calendars.
  3. Manually delete all references to imap.google.com, smtp.google.com, calendar.google.com and similar items from my login Keychain (simply select them and delete them)
  4. Go back to the Mail Preferences screen, and turn Mail & Calendars on again
  5. Click the "Details" tab in that screen, and enter the Google temp password
  6. Open Mail. Receiving email should just work, but when you send an email you'll get prompted for a password - use the same one used in step 5, and check the box to remember it.

I'm sure these steps are a bit of an overkill, but they worked for me, so I'm not complaining...

my best guess is that the use of multiple passwords to what is effectively the same google account somehow threw off Google or the Mac.

1
  • Most of my login keys were actually under smtp.gmail.com, imap.gmail.com etc, rather than google.com. Fingers crossed that it works Commented Nov 22, 2012 at 3:40
3

On Google's support site, regarding 2-step verification, they speak directly of this issue and say this it more or less comes down to being sure that your check off the "remember this password" box

Quoted directly from Google's support site:

Soon after you turn on 2-step verification, you'll be alerted that your password is no longer working (see image below). Enter an application-specific password that you generated in the "Password" field (1). If you want Mail to store your password for future sign in, you can click the box next to "Remember this password on my keychain" (2).

Sample 2-step verification dialog box for Apple Mail sign in.

1

I find that somehow the 'TLS Certificate' gets set. I change this to None, and it starts to work again.


In my case I use the following settings

  1. smtp.gmail.com
  2. TLS on port 465
  3. As password, I use my new two-way identification password defined here: SmsAuthSettings
0

I struggled with this problem for a long time before I figured it out.

To access a Gmail account protected by 2-factor verification in Mail, you need to make sure your Google account recognizes your phone as an authorized device. To do this, go to your two-step verification page:

https://accounts.google.com/b/0/SmsAuthConfig

and click "Manage application-specific passwords."

Then enter the password given in the mail app. You may have to delete and reset your mail account. This worked for me.

1

Not the answer you're looking for? Browse other questions tagged or ask your own question.