Backup Gmail using Mail.app and IMAP without redundancy

I don't care for actually using mail app. I use it just for offline access, for eventual quick reading and even more eventually replying. I use mostly the gmail interface.

So I've setup and tuned up it with gmail and everything is working fine. I think I've followed every guide out there... Here's a great one. But I could find nothing about avoiding redundancy.

Well, I can manually do that either by using only POP or by checking off most of my labels out of IMAP. But I do use a lot of labels and I often label messages with more than 1. And I want them on mail app.

Is there anyway to make it keep just 1 copy of repeated messages? Maybe there's a message id or checksum that could be used...

If there isn't a way to do it, be assured I still prefer having the extra messages and "wasting" space rather than not having any.

edit:

I've came across many solutions for finding duplicate files, but they just delete the files. That make things worst because Mail.app will sync it all again.

I've realized it's probably better to keep two accounts setup, POP for backup and IMAP for everything else with removing the "All Mail" from it. That's because if the "All Mail" on the server is deleted for any reason, my "All Mail" local will also get deleted, while POP will keep all files regardless of the server. This doesn't solve the redundancy issue at all, but it doesn't create any new issue as well, and I can even use the search properly, without duplicated results, if I search just on the POP. So it helps optimizing a little bit.

But I still think the best way to solve this issue would be having something such as aamann's Mail Scripts tweaked to hardlinking the duplicates rather than deleting, and optimized to not need to scan everything every time. I'm trying to contact him and see what we can do.

At any pace, I'm still looking for a solution!


Solution 1:

Hmmm, I'm not aware of any off-the-shelf product that will let you do this.

However, if you ran something (such as an IMAP server with Maildir) that kept each email in a separate file and you used a filesystem with deduplication...

Solution 2:

I have spent many evenings trying to find a solution that would allow me to use GMail with all it's features (like labels) from within desktop application, but had no luck. So far the best solution I have found is to

  • enable GMail Offline
  • install Google Chrome (for faster loading and better performance)
  • create application shortcut for GMail

Solution 3:

With Maildir one should be able to compare md5sum/sha1sum hashes and replace duplicate messages with hardlinks to the original (at least on Linux).

Solution 4:

Well, just an idea, would a dupicate file find do the job (I'm assuming you got the mail on eml files, or anyway.... "files"), so if they are redundant, ther content will be exactly the same, and any duplicate file finder would find them

Some duplicate file finders:

  • http://dll.nu/duper/

  • http://www.codeproject.com/KB/files/DuplicateFinder.aspx