So, over the past few days, I had an interesting issue with Android 2.1 (Eclair) on a Motorola Milestone.
Suddenly, it decided to stop syncing emails with Gmail. At the same time, syncing the calendar worked fine.
I tried solving this using by selecting another label, and then went back to the Inbox and it seemed to work, but in fact, it did not. It would show the correct number of unread messages, but the actual unread messages will be from an old sync. Very confusing.
Here is the solution:
Press Menu -> Settings -> Applications -> Manage Applications.
When you reach there, press Menu -> Filter -> All.
Scroll down to find "Gmail Storage", then click "Clear Data".
Confirm that scary looking dialog.
Things will be back to normal.