I’ve been seeing an issue with Apple Mail affecting several iPhone users on a several different of hosts:
- With a POP account, Apple’s Mail.app will ask for the password repeatedly, refuse the correct password and fail to collect any mail.
- With IMAP, the account seems to stall and does not necessarily update state or download new messages. Desktop IMAP behavior is particularly erratic.
In both cases, the iPhone continues to work just fine. The problems mostly affects users who’ve set their iPhone to Auto-Check for mail to something other than Manual. The following lines appear in the Desktop’s console.log almost immediately after setting the iPhone to auto-check for mail:
2007-07-05 15:33:17.190 Mail Unhandled response to command SELECT: * NO Trying to get mailbox lock from process 28292 2007-07-05 15:34:24.098 Mail Unhandled response to command SELECT: * NO Trying to get mailbox lock from process 29790 2007-07-05 15:36:14.917 Mail Unhandled response to command SELECT: * NO Trying to get mailbox lock from process 31080
Those entries seem to indicate that the IMAP server is sending a response that Apple Mail doesn’t know what to do with.
A thread on the MacRumors forums claimed this was a multiple connections issue with the mail server, but I think I’ve conclusively debunked that, at least for IMAP.
To test the multiple connection theory, I set up Thunderbird on two other physical machines, one Mac and a Dell running Ubuntu, then set up my account using the default IMAP settings. I also opened my account in Horde webmail and hit reload a lot. Despite those simultaneous connections, Apple Mail seemed to be fine and messages were getting delivered. The little progress indicator was, however, still sitting there next to the account name, not spinning.
So now I can break Apple Mail just by turning on Auto-Check in iPhone’s Settings->Mail. Manual checking from the iPhone doesn’t cause any problems. So far I’m only seeing this on shared hosts running the Courier mail server.
IMAP is inconsistent about when it breaks, maybe relating related to server load issue. POP will break every time: If I check my email on a POP account with the iPhone, Apple Mail will immediately ask for and then refuse the password for that account.
An IMAP workaround
Installing IMAP-IDLE, pretty much fixes the problems with IMAP. I’ve had this running for several hours and the iPhone checking every 15 minutes, and things seem to be working smoothly. IMAP errors still appear in console.log but mail is getting through. I’m going to install this on a few other machines tomorrow and see what happens.
Not sure what to do about POP, but then we’re migrating everyone over to IMAP anyway.