Jul 05, '05 08:57:00AM • Contributed by: zvonler
While using Mail, I found that I inadvertently created many duplicate messages (several thousand, in fact). I looked for some hints on how to handle such a situation, but most seem geared to pre-Tiger releases. So I wrote this Perl script to remove duplicate messages from a mbox-format directory, such as that used by Mail in Tiger.
If you paste the code into a file named undupe (make sure it's executable with chmod 755 undupe), then you can run the script from your ~/Library -> Mail -> Mailboxes directory (assuming that's where you saved the scriptt) as follows:
./undupe 'mailbox 1.mbox' 'mailbox 2.mbox' ...
As usual, I can provide no guarantees that this code will work for you, but it worked well for me. I also highly recommend backing up all of your mail before using this or any other scripts!
[robg adds: A previous hint provided an AppleScript to find duplicates directly within Mail. This hint is a command-line solution to the same problem.]
