A potential fix for Mail.app and IMAP problems

Dec 08, '03 10:52:00AM

Contributed by: rnayfield

I was having issues with Mail.app (10.3) and synchronizing mailboxes. As many people have suggested, I turned off "automatically synchronize" in preferences, but I still was unable to manually synchronize my mailboxes. I could log in and get my mail, but synchronize would fail.

My mail server is courier imap on linux. The synchronization would continue for a point and then suddenly stop, with the account take offline due to an error. The error message was NSStreamSocketSSLErrorDomain -9806, which suggests an SSL error.

But the real problem is that Mail.app is making a lot of connections. The default limit on Courier is 4. For me, just logging in makes three connections. When Mail.app attempts to create a fifth connection, Courier slams the door and Mail.app gets offended. To fix this issue on the server, find Courier's configuration file and modify MAXPERIP. Here is my example:

# grep MAXPERIP= imapd
MAXPERIP=15
My original value was 4. The exercise of finding your Courier etc/imapd file is left to the reader. My theory is that Mail.app wants to first negotiate SSL, and then be told that it cannot connect - but Courier drops the connection before the SSL negotiation. If this is the case, this issue will not manifest itself on unencrypted connections, and may not manifest itself on more "polite" IMAP servers which allow the SSL handshake to happen before rejecting the client.

It also would be great if somebody could figure out how to tame Mail.app. Not everybody has administrator access to their mail server. The plist file has a "CacheOveraggressively" key which sounds promising - but is only equivalent to the "Automatically Synchronize" on the advanced account pane - which doesn't help if you can't even manual sync your mailboxes!

Comments (15)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20031130150826388