Dovecot / IMAP bandwidth spikes for iOS devices
A number of accounts on my WHM server have been suffering random bandwidth spikes over the past couple of months. I've narrowed the problem down to mailboxes accessed over IMAP and through iOS-based devices are resyncing unnecessarily. Android phone users or desktop accounts don't seem to suffer this issue, even if the mailbox is holding many GBs of email.
I can't expect clients to ditch their iPhones, so am wondering if something in the server needs adjusting to alleviate the problem? The Mailserver Configuration settings are mostly on factory defaults as far as I can tell.
Some example log entries:
Feb 14 07:41:05 myserver dovecot[3983753]: imap(example@domain.com)<1582521><EKiaRRUuReMff0NJ>: Disconnected: Connection closed (UID FETCH finished 93.051 secs ago) in=34849, out=175383552, bytes=34849/175383552
Feb 14 07:41:53 myserver dovecot[3983753]: imap(example@domain.com)<1582956><mb2NSxUuSuMff0NJ>: Disconnected: Connection closed (IDLE running for 0.001 + waiting input for 4.386 secs, 2 B in + 10+2 B out, state=wait-input) in=10825, out=40056367, bytes=10825/40056367
Feb 14 07:41:53 myserver dovecot[3983753]: imap(example@domain.com)<1583050><4lUiTBUuTOMff0NJ>: Disconnected: Connection closed (IDLE running for 0.001 + waiting input for 4.591 secs, 2 B in + 10+2 B out, state=wait-input) in=7633, out=29924667, bytes=7633/29924667
Feb 14 07:41:53 myserver dovecot[3983753]: imap(example@domain.com)<1582957><INWPSxUuS+Mff0NJ>: Disconnected: Connection closed (UID FETCH finished 0.160 secs ago) in=28045, out=139784954, bytes=28045/139784954
-
Hey there! I'm not aware of any general issues with iOS devices and IMAP. In fact, a majority of the cPanel team uses Apple tools for work.
One thing that may help would be to search the log to see if you can narrow this down to a particular IP address, or maybe a small pool of addresses, so you could see who is connecting the most times. Just replace the email address inside the quotes at the beginning of the command with the address you want to look for and it will print out the number of times their IP address has connected to the server to download mail:
grep "user@domain.tld" /var/log/maillog | grep -o '[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}' | sort | uniq -c | sort -nr0 -
Thanks for the reply and guidance.
I have already isolated it to a handful of email boxes (out of 300+) on the server. The common trait is they all use iPhones over IMAP.
From what I can discern in /var/log/maillog I believe the affected IMAP clients are frequently disconnecting and reconnecting, particularly during UID FETCH and IDLE states, but I don't know what steps I can take to improve matters other than telling them to swap to Android!!
I have the following values set in Service Configuration > Mailserver Configuration:
Maximum IMAP Connections Per IP Address = 30
Interval between IMAP IDLE "OK Still here" messages = 24
Idle Hibernate Timeout (Seconds) = 30
Idle Check Interval = 30The below graph taken from the bandwidth section on one account shows the scale of things. The user's typical volume of email hasn't changed, but back in November 2024 they purchased a new iPhone running iOS 18 and suddenly their IMAP traffic surges:

Their daily IMAP bandwidth usage would suggest their entire mailbox is being re-synced every few hours.
Any further input would be greatly appreciated.
0 -
Thanks for the additional details. I spoke with the email team about this and we haven't had any similar reports of this behavior.
I believe the best course of action would be to create a ticket so this can be investigated directly on the server, as we'll need to see all the mail logs to determine what is happening here.
0
Please sign in to leave a comment.
Comments
3 comments