Removing duplicates from mail base

Kjetil Torgrim Homme kjetilho at ifi.uio.no
Thu Jul 6 12:12:35 EDT 2006


On Mon, 2006-07-03 at 22:10 +0800, Wouter van Marle wrote:
> I've a rather peculiar issue. I have a rather large archive of e-mails
> in the cyrus imap format. But due to copy errors while migrating to the
> cyrus server, I now have ended up with many many duplicate e-mails. And
> I'd like to take these out.
> 
> These duplicates are the same down to the message-ID.
> 
> Does there exist a built-in tool or so to clean a cyrus mailbox and all
> it's children from duplicates?

I haven't tried it, but there was a script posted to this list a few
years ago:

http://www.irbs.net/internet/info-cyrus/0311/0147.html

> Alternatively I think I can relatively easy hack a script together that
> checks for dupes, and deletes the affected messages. Is it a good idea
> to start working on cyrus' mail store directly? (of course I have a
> backup - but will the server accept this?). It seems to me the mails are
> stored in single plain-text files, so using normal string functions I
> can easily grab the messageID and remove any duplicates.

you have to run reconstruct afterwards, and probably quota -f too, but
Cyrus will handle it nicely.
-- 
Kjetil T.




More information about the Info-cyrus mailing list