copying and renaming mailboxes to clean up directories

Andrew Morgan morgan at
Wed May 2 19:51:48 EDT 2007

On Wed, 2 May 2007, Thorsten B=FCker wrote:

> Thanks for this clearification! After comparing some cyrus.header files f=
rom =

> different folders and "my" seen file, I think I understood ;-)
> While copying the mailbox the message UIDs change, at least as far as I c=
an =

> see. So, one might be able to replace the mailbox IDs in the seen file be=
 the =

> mailbox IDs of the copied version, but the message UIDs referenced to are =

> out-dated. Or do I miss something?

You are correct that the message UIDs will change anytime a message is =

copied.  Also the mailbox ID will be different for each new mailbox.  If =

you want to maintain the seen state during the copy, you'll need a fancier =

script than the one I wrote.  :)

>>> Another attempt:
>>> Are there any reasons, why something like
>>> =

>>> ORIG=3D`grep -R -e '^Message-ID:' $originalmbox | awk '{print $2}' | so=
>>> KOPIE=3D`grep -R -e '^Message-ID:' $copyofmbox | awk '{print $2}' | sor=
>>> =

>>> some diff and some improved awking (spaces won't work in case of spaces=
 in =

>>> folder names) is not a sufficient way to create a list of files, which =

>>> might be deleted in the original mailbox?
>> =

>> That sounds like a reasonable approach, but obviously you should be care=
ful =

>> anytime you modify the cyrus files directly.  :)
> Well, actually only the files/message themselves are touched. Ok, they're=
 not =

> simply touched but deleted ;-)
> Further Cyrus files (cyrus.*, seen state, subscription list)
> are not affected. Furthermore one might assume that they correspond to th=
e =

> mailbox contents after deleting any "wrong" files/messages.
> I hope to find a reasonable approach to create a list of unnecessary =

> Message-IDs and their corresponding files, which might be piped to remove=
. =

> Keep you informed.

If you can figure out the message-IDs to delete, then it should work fine.


More information about the Info-cyrus mailing list