I was having the same trouble. I don't have an answer, but I do have a workaround. Here goes:
- Access your email account from a computer (i.e. not iPhone). Either web-based (e.g. MobileMe) or imap-software (e.g. mail.app on a mac) should work.
- Choose one of your mailbox folders and sort the emails by date with the newest first
- Create a new mailbox folder and call it "temp" (or anything really)
- Move (drag) all the emails from an existing mailbox folder to the new "temp" folder
- Give the program a minute or two to make sure all the imap info is updated
- Check that the mails in the new "temp" folder are still sorted by date with the newest first, re-sort if not.
- Move (drag) all the emails back from the "temp" mailbox folder to original folder
On the PC/mac it won't look any different than when you started, but when you now check that folder on your iphone, it will say "downloading messages" and then you should find that all the emails are in date order with the newest first.
Note that if you only have your phone set to display 50 messages, you only need to move the most recent 50 messages to the "temp" folder and back.
This process needs to be repeated for all the email folders you have. However, it only needs doing once, since any mails you move after this will automatically be added to the top of the iphone mailbox (and presumably they are new mails you have received).
Worked like a treat for me...