We, too, have continually encountered this problem. The weird part is that it seems to occur after an indefinite amount of time. Specific data requested below.
---------------------------------------------------------------
PRODUCT, VERSION, MICROUPDATE, OPERATING SYSTEM, ARCHITECTURE
Plesk 12.0.18 Update #64, last updated at Sept 9, 2015 04:03 AM
CentOS 6.7 Final on x86_64 architecture.
PROBLEM DESCRIPTION
After an indeterminate amount of time, those using iOS only (no other device users have reported this problem) are suddenly unable to authenticate with the following error in the maillog:
Sep 8 04:57:48 {SERVERNAME OBSCURED} courier-imaps: Connection, ip=[::ffff:{IPv4 OBSCURED}]
Sep 8 04:57:48 {SERVERNAME OBSCURED} courier-imaps: LOGIN FAILED, user={EMAIL ADDRESS OBSCURED}, ip=[::ffff:{IPv4 OBSCURED}]
Sep 8 04:57:48 {SERVERNAME OBSCURED} courier-imaps: authentication error: Input/output error
STEPS TO REPRODUCE
This is the tricky part. There are none since it occurs randomly. The closest I can come up with would be:
1) Configure a mail account in Plesk 12.0.x
2) Set it up on an iPhone with latest iOS as noted above
3) Use it as normal and continue doing so for weeks or months until this issue occurs.
ACTUAL RESULT
Eventually, you'll randomly start getting the errors as described above.
EXPECTED RESULT
Mail connectivity continues as normal without any authentication errors.
ANY ADDITIONAL INFORMATION
There is no correlation with iOS version in that this issue was occurring years ago when iOS was at version 5 or 6 and it continues now with the latest iOS v8.4.1 installed. There is no correlation in terms of Plesk version in that it has occurred with v11, 11.5 and now 12.0.
Since this has occurred on Plesk 12 where we can configure MAX_DAEMONS and MAX_PER_IP via the GUI, we have always had those set to very high values like 500 and 80 respectively. When this very same server was running Plesk 11.0 and 11.5 we manually configured those values. Plesk appears to apply those values to both /etc/courier-imap/imapd and /etc/courier-imap/imapd-ssl with version 12.
We make use of our own purchased wildcard SSL certificate that matches the server name (so there is no mismatch error when clients connect).
It may be important to note that we have never seemingly encountered this issue for those connecting via port 143 and using STARTTLS. The logs that I've seen thus-far indicate it ONLY occurs when using port 993 (seemingly without STARTTLS). My own iPhone, for example, connects on 143 with STARTTLS and I've never personally encountered this problem.
At this time we use CSF firewall. Port 993 and 143 are most definitely allowed through (otherwise we'd get no logging at all and all devices wouldn't be capable of connecting). We encountered this issue years ago before we even started using CSF firewall.
As others have reported, removing the account from the iPhone and re-adding it resolves the problem each time. Yet a reboot of the iOS device doesn't change anything. Neither does attempting to reconfigure the account with the known-good settings; it just keeps failing until you completely remove the account and re-create it.
My guess (purely conjecture) as to what's happening is that iOS suddenly finds its unable to connect to the server (for reasons unknown at this time) and attempts to renegotiate the authentication paramaters. Perhaps since it thinks the initial settings aren't an option (as they were failing) it never cycles back to try them again, but of course other combinations of ports and authentication mechanisms fail as well as the server doesn't support them.
Another possibly related situation is that we've encountered similar behaviour in the past with Apple Mail on OS X 10.10 where the app randomly attempts to reconfigure the mail connection to resolve an unknown connectivity issue (it never tells me when it does this, so I don't know what that issue is; it happens in the background). To prevent this from happening, I had to Uncheck the box under "Advanced" that says "Automatically detect and maintain account settings". Unfortunately this isn't an available option on iOS.
--------------------------------------------------------------
POSSIBLE SOLUTIONS:
As some have suggested in this thread, I have now disabled IDLE from the list of IMAP_CAPABILITIES. I don't know if this will solve the problem, time will tell.
I have made one other change that I believe may be the real source of the issue (but it's purely a hunch). Since this problem seems to affect authentication and number of connections, I discovered the following config value in /etc/courier-imap/authlib/authdaemonrc : daemons=5
I have increased this value to 15 (arbitrary) simply to see if iOS may be maxing out the number of simultaneous authentication connections. The comments in the config file DO indicate:
You may need to increase daemons if as your system load increases. Symptoms include sporadic authentication failures. If you start getting authentication failures, increase daemons.
Which sounds a lot like what we're experiencing. My only hesitation in this being the solution is that one would imagine this issue would occur across devices and OS versions and not be limited to just iOS.