osx applemail imap mbox emlx duplicate emails email messages
April 16, 2009 6:33 AM   Subscribe

If I make changes using a command-line utility to an mbox file that is the local cache of an IMAP account, how can I get those changes uploaded to the server? (Mac OS X 10.4, Mail.app, Perl script.)

I use Mail.app for my Gmail and work email, both of which use IMAP. I have a local cache of everything that gets synced when I'm connected to the internet.

I have a bunch of duplicate messages within both of these accounts. I found a Perl script that will go through all the emlx files in each local mbox directory (i.e., the local cache) and delete dupes. But I'm thinking that when I connect again and Mail.app sees that there's a bunch of messages on the server that aren't in my local cache, it'll just download them again.

How can I get Mail.app to tell the servers that the messages that are missing on the local copy should be deleted from the server copy, too?

I've tried using this AppleScript that deletes the messages within Mail.app, but it's way to slow on my machine. The command-line Perl script is so much faster.
posted by DLWM to Computers & Internet (3 answers total)
Why are you doing this? Why not run multiple clients against the imap server? Remove the dupes with your client (thunderbird can do it) and you're done.
posted by devnull at 7:38 AM on April 16, 2009

Maybe you're overthinking this?

If you're using IMAP as you say you are, then why not just blow out your local copy of your mail and allow Mail.app to re-download your mail folders and their contents? This would ensure that your local IMAP cache is identical to your email server's contents.

Is the problem that the duplicate emails are on the server?
posted by mrbarrett.com at 8:39 AM on April 16, 2009

There is no such thing as a local copy of an IMAP account. IMAP is a transfer protocol not a storage protocol. You just have some emails in various folders. If you manually muck around with your local storage it wont be translated into IMAP commands anywhere.

Why not just do what mrbarrett.com said?
posted by damn dirty ape at 11:29 AM on April 16, 2009

« Older SQL Query Question   |   Skate by Number? Newer »
This thread is closed to new comments.