Dispatch plays nicely with Gmail / Google Apps’ archive to All Mail process, however Mail.app on OS X doesn’t, it creates a whole new folder called Archive on Gmail which just looks ugly and causes other little annoyances, like sometimes storing the mail locally in an Archive folder and not syncing it to Gmail, therefore not making it searchable away from the desktop. Aghh!
While I mostly process my email first thing in the morning, and last thing in the afternoon, occasionally I do need to deal with new email on my Mac as I’m standing in front of it most of the day…this is when hitting Mail.app’s Archive button becomes a pain. I don’t understand why Apple hasn’t fixed this as they allow you to set other folders for certain things, i.e. Use this folder for Drafts, Sent, Junk, Deleted items.
Anyway, long story short I stumbled around the web trying to find a hack or solution to this as and there was a load of different options that appeared to work under OS X Lion, however nothing definitive under OS X Mountain Lion. I had seen the below suggestion used for forcing folders other than the defaults, and with a tiny modification it worked perfectly in Mail.app on Mountain Lion.
All you need to do is first quit Mail.app, then locate Mail.apps’ Accounts preference list, which should be located here (remember to change matpacker to your username);
Then modify the ArchiveMailboxName setting to [Gmail]/All Mail and then restart Mail.app.
Depending on your Google service you may need to set it as [Google Mail]/All Mail, but you’ll see that information in the Accounts.plist file for the other folders.
Now whenever you hit the Archive button in Mail.app on OS X it will archive the email to the All Mail folder on your Gmail account.
It’s that easy.