I have an IMAP mail account with a web hosting provider.
The account is accessed by two clients: Mail.app on a MBP running Yosemite, and Mail on an iPad running iOS 9.
When I delete or archive a message from the Inbox using the OS X client, the message still shows up on the iPad, unread and not deleted. Only when I delete it on the iPad, it ends up deleted on both devices.
As a result, the Inbox on the iPad is humongously large.
The root cause seems to be that Mail.app is only marking the message as deleted, rather than moving it somewhere. When I access the account through the webmail client, deleted messages show up like so:
I haven't changed any relevant settings in Mail.app that could be causing this. The "Move messages to trash when deleted" checkbox is active as I suppose it should be. I can't find any other settings related to this.
The problem persists when I manually move a message to the trash IMAP folder: it shows up in strikethrough in the webmail client, and not deleted on the iPad.
There is a lot of advice out there (example), but I haven't found anything that works. Following the most frequent bit of advice, I have deleted and re-added the IMAP account on the iPad multiple times. That solves the problem - the number of messages on the iPad then matches the number of messages in Mail.app. However, for every subsequent message that comes in, the problem comes back.
What is the cause of this?