reconstruct after deleting folders

William K. Hardeman wont-i at wkh.org
Thu Sep 19 16:43:27 EDT 2002


Kai,

I ran into this problem myself awhile back. The _best_ way to move folders 
in this manner is to do it in your imap client program. However, if you 
want to do this by hand (say, for a number of users via a script), you can 
do the mv command, but you then need to export your mailboxes.db file to a 
text file, edit the location of the moved folder and import the mailboxes 
back into the mailboxes.db. The error you're getting is because, in 
mailboxes.db, there is an entry for the spam folder at the directory level 
it used to be at. A reconstruct -rf will find and add the new spam folder 
location, but it cannot remove the old mailboxes.db entry or modify it.

As cyrus,

ctl_mboxlist -d > mailboxes.txt
vi mailboxes.txt and edit your old spam entry
ctl_mboxlist -u < mailboxes.txt

HTH,
Will

--On Thursday, 19 September, 2002 22:01 +0200 Kai Groshert 
<kai at groshert.de> wrote:

> Hi everybody,
>
> I'm not sure I fully understood the function of "reconstruct", so if
> anyone could give me a hint here...
>
> I'm trying to move one mailfolder for the user "dimitri", which is
> located in /var/spool/imap/user/dimitri:
>
> -rw-------    1 cyrus    mail            4 Sep 19 22:47 cyrus.cache
> -rw-------    1 cyrus    mail          181 Sep 19 22:47 cyrus.header
> -rw-------    1 cyrus    mail           56 Sep 19 22:47 cyrus.index
> drwx------    2 cyrus    root          117 Sep 19 22:47 drafts
> drwx------    2 cyrus    root          117 Sep 19 22:47 sent-mail
> drwx------    2 cyrus    root          117 Sep 19 22:46 spam
> drwx------    2 cyrus    root          117 Sep 19 22:51 trash
>
> I'm trying to move the "spam" folder below the "trash" folder (using
> "mv"). After this I obviously need something like reconstruct, but it
> gives me this:
>
> cyrus at centauri:~ > reconstruct -r user.dimitri
> user.dimitri
> user.dimitri.drafts
> user.dimitri.sent-mail
> user.dimitri.spam: System I/O error No such file or directory
> user.dimitri.trash
>
>
> So I thought, well, the "-f" option looks promising, but wait:
>
> cyrus at centauri:~ > reconstruct -rf user.dimitri
> user.dimitri
> user.dimitri.drafts
> user.dimitri.sent-mail
> user.dimitri.spam: System I/O error No such file or directory
> discovered user.dimitri.trash.spam
> user.dimitri.trash: Mailbox does not exist
> user.dimitri.trash.spam
>
>
> So it found the moved mailbox, but it didn't remove the missing one.
> Using "reconstruct -m" doesn't work either: "reconstructing mailboxes.db
> currently not supported".
>
> I'm not sure if the quota command should help, but I get some error too:
>
> cyrus at centauri:~ > quota -f
> __db_assert: "0" failed: file "../dist/../db/db_cam.c", line 86
> Aborted
>
>
> Still, if I run it on a single mailbox (not the modified one), it works:
>
> cyrus at centauri:~ > quota -f user.christin
>    Quota  % Used    Used Root
>   250000       0       2 user.christin
>
>
>
> Does anybody know what I'm doing wrong? Is there any way to make imapd
> aware of removed folders?
>
> Any hint would be greatly appreciated. I'm quite confused.
>
> I'm using cyrus-imapd 2.0.16.
>
>
> Regards,
> Kai
>
>
>
>



----------------------------------------------------------------------------
William K. Hardeman
wont-i at wkh.org
http://www.wkh.org

The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka!" (I found it!) but "That's funny ..."
                -- Isaac Asimov

Always listen to experts. They'll tell you what can't be done and why. Then
do it.
--Robert A. Heinlein




More information about the Info-cyrus mailing list