Can it be that Mail in Mac OS X 10.7.4 is broken? While the Mail client (Version 5.2 (1278)) works fine with most IMAP servers it does not with the IMAP on my Mac OS X Server 10.6.8. Other clients from iOS devices and older versions of Mail still work fine. Alos, if I use Postbox I can perfectly use my IMAP account on the Xserve.
Looking at the log-file it seems that the server doesn't get certain information like the login-name. Here a snippet from the log-file (one connection from an iOS is working another fails):
May 14 07:15:52 apfel com.apple.securityproxy_mail: V1:IMAP:ACCESS[client:xx.xx.xx.xx:49577, proxy:xxx.xx.xx.xx:999, server:xxxxx.xxxxxxxx.xxxxx.xx:993, connected_secs:1, user:xxxxx, client-authmethod:IMAP-LOGIN, proxy-authmethod:CRAM-MD5, client-transport:ssl, server-transport:ssl, state:server-authorized, result:OK. Connection was closed cleanly.]
May 14 07:20:52 apfel com.apple.securityproxy_mail: V1:IMAP:ACCESS[client:xx.xx.xx.xx:52652, proxy:xxx.xx.xx.xx:999, server:xxxxx.xxxxxxxx.xxxxx.xx:993, connected_secs:180, user:, client-authmethod:, proxy-authmethod:, client-transport:ssl, server-transport:ssl, state:proxy-connected, result:BAD. User not authorized by proxy server. No valid auth method from client. Verify that client and server are configured for mobile access. Connection was closed cleanly.]
Note that I am using the mobile access server so that users from outside connect (e.g.) to port 999 and it gets internally forwarded to the IMAP port 993. This is certainly not the problem. I get the same problem when I directly connect with 993. And anyway, no other mail cleint has a problem!
Edit: A year a ago I had a smiliar problem. However, it was the way around. The mail client on the iPhone caused exactly this problem while the mail clients on Mac OS X worked fine. So just lookup the guy who was fixing the mail client on iOS recently ;-)