Has something changed with gmail imap recently? I use Apple Mail every few days mostly just to keep a backup of my several gmail accounts. After reading this I remembered I hadn't done this in a few days so I opened Apple Mail on my Macbook (not upgraded to Mavericks yet) and got password prompts for each account. None of the passwords I entered was accepted. I can log in through the web just fine.