iPhone/iPad IMAP connection bursts causes user+IP exceeded

Joseph Tam jtam.home at gmail.com
Fri Oct 28 20:49:54 UTC 2016


I frequently see this from my iPhone/iPad IMAP users:

 	Oct 24 21:30:55 server dovecot: imap-login: Login: user=<user>, ...
 	[... repeated 10 times ...]
 	Oct 24 21:32:54 server dovecot: imap-login: Maximum number of connections from user+IP exceeded (mail_max_userip_connections=12): user=<user>
 	Oct 24 21:32:54 server dovecot: imap(user): Logged out ...
 	[... repeated 11 times ...]

These bursts of logins/max/logouts would cycling on for a few minutes.
Googling this problem seems to turn up lots of similar complaints about
iOS mail mail clients. e.g.

 	https://discussions.apple.com/thread/2547839?tstart=0

iOS mail readers do not limit connections limit as other mailreaders
can.  I could increase mail_max_userip_connections, but that just moves
the goal posts.

Using the new rawlog feature in 2.2.26 (thanks Dovecot team!), I was able
to see that these connection bursts are caused by clients doing global
searches.  The rawlogs show each mailbox being SELECT'd and searched
(e.g. From header string):

 	1477369968.730450 2 ID ("name" "iPad Mail" "version" "13G36" "os" "iOS" "os-version" "9.3.5 (13G36)")
 	1477369968.781932 3 SELECT {mailbox}
 	1477369968.961636 4 UID SEARCH RETURN (COUNT) 1:* NOT DELETED
 	1477369969.006087 5 UID SEARCH RETURN (ALL) 1:* NOT DELETED
 	1477369969.052701 6 UID SEARCH RETURN (ALL) {search-term} NOT DELETED
 	1477369974.624153 7 LOGOUT

Questions:

 	1) How does this affect the user?  I heard from one user that it
 	makes global searches unusable because his reader just spins its
 	wheel.  I'm not sure whether this is impatience or this results
 	in failed searches.

 	2) Is there a client-side fix (e.g. connection limiting)?
 	Apple appears to be intransigent on addressing this.

 	3) Will maintaining search indices (e.g. solr) help with this?
 	Maybe the searches are taking too long and the connections pile
 	up waiting for previous searches to finish.

Thanks,
Joseph Tam <jtam.home at gmail.com>


More information about the dovecot mailing list