iPhone mail out of sync with server

I am on macOS Sequoia 15.1.1 and iOS 18.1.1. I have a Mac Mini that moves messages to a mailbox folder called “System_ok” on the mail server. It uses rules based on sender and subject in Apple Mail. This has been going with no problems for several years.

The problem is that on my iPhone some mails, not all, are still in the Inbox. On my Mac Mini and a MacBook Pro, all the messages are in “System_ok”.

I have checked on the mail server, the messages are in “System_ok”.

Maybe the iPhone gets the mails before the Mac Mini has used its rules to move them? I have changed Fetch to “Every 15 minutes” today. I hope that will help with new mails coming in. It was Fetch Automatic up to now. Any thoughts?

What can I do to sync the Apple Mail already on my iPhone with the mail server? Dragging down to sync does not help.

Assuming that you are using IMAP, I’d consider turning off mail in settings / apps / mail / accounts (or even deleting the account, if it’s not an iCloud account that’s your Apple Account) and turn it back on (or add the account back if you can delete it.)

As Doug says, delete the account and re-add it should cause all mail to be redownloaded. Like rebuilding a mailbox but that doesn’t seem possible on a iPhone.

For the future why not put the rules server side on iCloud.com instead of a local device?

The problem is not with my iCloud mail. I have moved most of my mail off iCloud because of Apple server-side spam filters removing important mail. Tidbits mail was among the mail getting silently filtered. Thanks @mikebhm.

It is an IMAP server. I tried turning off mail overnight. It did not help. Deleting the account and adding it back solved it. Thanks @ddmiller

Well, that did not help. I now have set all to fetch manual and I kill Mail.app after reading. This workaround has been working good so far.