Turns out the Mail on the iPhone no longer received new messages that did arrive to the account, but continued to show that there were five unread messages in the inbox when there were none.
I tried deleting the account altogether, hard restarting the phone, and the adding the same account again, and once again it showed five unread messages when there were none in the inbox.
Any other suggestions? Other than a full restoration?
I have had a few times where I thought I was seeing the same thing as you, then I found it was really seeing an unread message in a folder other than the inbox and reporting that as my unread message in the badge.
Another thing I see form time to time is that I may read all the messages in my inbox and when I back out to the accounts list, it still shows the same number of unread messages For me the solution is quite simple, I scroll the accounts list until that account no longer shows on the screen, then when I scroll it back in view, it now properly shows no unread messages. If your iPhone mail app is having trouble reaching your mail server this could easily be the cause for your "phantom" messages.
I get this issue every single day, and it is specifically reproducible. Here is the scenario:
1) I have two mail accounts configured on my iPhone, one is my work account and is disabled on the phone, the other is my gmail account which is always enabled on my phone
2) Each morning, when I head into work I enabled my work email account so I can start reading my work emails for the day. This downloads all the new messages from the server and displays them as unread.
3) I read some of them, but not all of them.
4) Once I get to my office, I read all of the rest of my new work emails from the Mail app on my MacBook Pro.
EXPECTED: The messages that are read on the mail app are updated as read messages
OBSERVED: On my iphone, not all of the messages have their statuses changed to read. Some of them always remain as unread messages
5) Next, I delete some of the messages read from my computer from the email server altogether.
EXPECTED: These messages would also appear deleted when using the mail app on my iPhone
OBSERVED: Not only are the messages not deleted, but they are still listed as unread
The only way to resolve this each day is for me to select each message and view it for a second to have the unread message indicator removed. I have to turn off the mail account and turn it back on for it to correctly sync with the mail server and correct the mistakes.
There is clearly a problem within the iPhone mail app with retrieving updates from the mail servers.
I have an iPhone 4 running iOS 4.2.1 that I purchased in November. Before that, I had an iPhone 3G S and never experienced the issue on my 3G S. My MacBook Pro was used with both devices.
krtrice, I often do exactly the same thing, often turning the mail on and off etc.
I've just been experiencing the same issue, phantom 78 unread emails on the phone, every email read in outlook at work.
After much messing about, the only way I've found to solve this is to mark the last month or so's emails as unread in outlook. Let the iPhone update and get the same unread number as outlook. Then mark all the emails as read again in outlook, again let the phone update and it should go back to 0 unread.
It just did for me anyway. You have to let the phone fully sync with outlook before marking them as read again and re-syncing.
Hope that helps...
It's a legitimate problem. Searching around we're not the only ones to experience it, and it's NOT due to some overlooked message hidden in a folder somewhere. (Yahoo shows an unread message count for each folder online anyway--you'd know it if you had it.)
I tried everything (hard & soft reset, deleting and re-adding the account, etc.) to no avail. Just tonight I removed the account and added it as an IMAP account as described here (http://discussions.apple.com/thread.jspa?threadID=2741882&tstart=15) (search for IMAP) and it worked.
The unread email account is correct and push is working again. My calendar isn't synched but I'll accept that until Yahoo & Apple can work out the issue.
Guess what, i have the answer. go into the library folder (in lion they make it so you can't see this folder. to get into it, go to your "go" menu from finder with the option button held down and go to library), then go to mail, then go to the folder V2, then go to the folder "maildata". move three files to your desktop (or anywhere out of the way): "Envelope Index", "Envelope index-shm" and "envelope index-wal". then re-start mail. it should fix the whole problem. It worked for me. after this, you can delete the old files from wherever you put them.
btw i use lion, so this may not work in snow leopard.
I think I may have found the problem. I too suffered from inaccurate message count in Mac Mail for months and it was making me bananas. If you sort by unread, you'll notice that notes you've created will show up first. At least it did for me as I often create notes from my iPhone and they sync with my mail client. I went through all of the notes and watched the message counter clear itself.
Hope this info is helpful. I'm so glad to see my ACTUAL email count.