Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'less cumbersome method' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
less cumbersome method
Authored by: Lee Phillips on Oct 28, '02 11:14:46PM
I don't use Apple's Mail program, but I believe that it uses standard unix format mail files. In that case, all you have to do is make a shell script:
#!/bin/sh
formail -q -D 1000000 idcache  $1.bk
mv $1.bk $1
rm idcache
Run this with the name of your mail file as input, and it will zap the duplicates.

[ Reply to This | # ]
corrected script
Authored by: Lee Phillips on Oct 29, '02 09:09:52AM

It seems that the software that runs this site is broken, and mangled the script that I posted. I'll try again, submitting it this time as plain text:

#!/bin/sh
formail -D 1000000 idcache < $1 -s > ztmp && mv ztmp $1
rm idcache

If you save this somewhere in your executable path and call it "zap", then you just type

zap mailfile

to remove the duplicates from the mail file mailfile.



[ Reply to This | # ]
LF/CR
Authored by: david-bo on Oct 31, '02 01:01:45PM

Does this script handle Mac-line endings (^M) ? Eudora stores its mailboxes in mbox-format but with Mac-LF...



[ Reply to This | # ]
Brilliant!
Authored by: bobme on Oct 29, '02 11:21:36AM

<Sorry this is added in wrong place -- I've gone blind and can't see how to add a new comment>

Anonymous, your hint is brilliant! How did you ever discover this? I have been looking for a good way to remove dupes in Mail for a long time, and I even asked some Apple developers for thoughts. Who would have thought that it was already in there, undocumented??

Here is one subtlety to be aware of: I tend to have duplicate messages where sometimes the attachment has been omitted. The selection routine you describe will ignore the existence of attachments, and so it is likely that the "good" message will be one without the attachment. My simple fix is to go back to the original folder and copy over any msgs with attachments into the new temp folder. This will result in some dupes, but I avoid losing any attachments. Anyone have a better method?

Thanks,
Bob



[ Reply to This | # ]