I've only recently returned to using Mail.app; for a couple of years I was almost pure Google. Since I integrated my personal Contacts across OS X Address Book/MobileMe/iPhone/Google Contacts however I've returned to enjoying the power of a dedicated email client.
Alas, there's a catch. In my time away I'd forgotten the Gmail IMAP to Mail.app sync duplicate email problem. It's not really a Mail.app specific problem, every IMAP client has the same problem.
This is an intractable problem. The standard model for email is that that every message belongs to exactly one folder. Folders can contain folders. It's very much like traditional directories since the days of DOS and well before. (Tree data structure)
Google has a very different model. Google's mail "folders" are an illusion, in reality all Gmail messages are in a single repository. Each message can have many tags, and a single tag can be used for many messages. Each tag is treated in the UI like a "folder", but a message belongs equally to each "folder' (they're just tags).
This is more than a mere "physics" problem -- it's a math problem. 7 != 3, and a tree-type folder hierarchy cannot represent a tag collection.
There are two approaches to "synchronizing" a traditional email application with Gmail. You could make the first tag of an message the "folder" tag, and ignore the other tags. The other approach, which Google took, is to replicate emails. So a single message in Gmail with 4 tags becomes 4 messages in Mail.app in 4 folders.
Of course this wastes space, but space is cheap. Much worse, however, is that it clogs up searches.
I don't see this problem going away - unless Google admits defeat and regresses to using standard folders. For now, however, I'd love to see a program that would go through my Mail.app database and remove all the duplicate emails - even if it randomly assigned them to a single folder.
See also:
- TidBITS Networking: Achieving Email Bliss with IMAP, Gmail, and Apple Mail. I don't think he's anywhere near bliss, but there are lots of details. Alas, if you use tags in Gmail, all of this explication won't help.