Doug,
My problem is similar to others on this thread including yours. I cannot match the emails in my Apple Mail Inbox and Sent folders to those shown on my Gmail account Inbox and Gmail folders. I followed the procedure that you outlined to uninstall and reinstall the account. For a few minutes, I thought it did the trick, but it did not. When I created the new account, the number of emails in Apple Mail did not coincide with the number of emails in my Gmail account. So, I proceeded to go to the Library/Mail/Maildata and remove the Envelope files. It then rebuilt the files and everything came up fine. The emails in the Apple Mail Inbox and Sent folders exactly matched those in my Gmail account. I though I was home free. However, as soon as I quit the Apple Mail and reopened it, I was back where I started.
At that point, I, again, went to the Library and removed the Envelope files. This time, when I opened Apple Mail, I could watch the progress bar in Maill Activity as it showed, for example, that 7 emails were downloaded into the Inbox (which is the correct number of emails in the Gmail account). But, when I went to the Apple Mail Inbox, there were only 3. As far as the All Mail folder on Apple Mail is concerned, all of the correct number of emails have been downloaded and both Apple Mail and Gmail account match, so that is not the problem. I just cannot get Apple Mail and Gmail to match up in the Inbox and Sent folders.
I looked thru the Gmail Account and everything looks good there.
Any suggestions would be appreciated.
I am using latest version of Yosemite on my iMac 27".