So add me to the list of people with Apple Mail issues, specifically on iPad and iPhone after upgrading to IOS 18.x. I run a dovecot server. In my case, I enabled debug logging for IMAP and found the iPad starting to prefetch messages then stopping in the middle of that with no error. It would just stop and eventually reconnect, try again, and repeat the pattern. Meanwhile, on the client, I saw a message about Downloading messages that hung indefinitely.
Per a suggestion earlier in this thread, I added "mail_prefetch_count = 50" to my dovecot.conf and now it works fine. My theory is that if Apple Mail experiences the slightest delay when fetching messages, it hangs. It is a new problem for me. I've been running Apple Mail (on iPad and iPhone) with dovecot for years without issue and without having to change that setting.
Also, other email clients like Outlook worked fine without the dovecot change. The issue is specific to Apple Mail (on iPad and iPhone). Apple Mail on my Mac also worked fine without the dovecot change.
Hopefully this helps someone, at least if you're hosting your own server.