Reconstructing a cyrus mailbox on Mac OS X Tiger (10.4)

The mailbox of a user on an OS X 10.4 Server started acting up, so I had to do something. I used the GUI (Server Admin)-Buttons to reconstruct and repair the cyrus databases and, nothing happened. An insane amount of messages was shown in the “Sent Messages” Folder, trying to open that folder showed it empty. A quick ls listed a healthy amount of messages.

Next I tried the procedure described in the document Reconstructing cyrus mailboxes in Mac OS X Server 10.3, 10.4, again, all stayed the same. But hey, OS X is a *NIX system, isn’t it? So I checked the backup (you have one too, right?) and did what I would usually do on any other *NIX system running cyrus:

  1. check man reconstruct and
  2. use the command accordingly.

Number one is very important, always make sure that you are aware of the actions reconstruct will execute. I hadn’t checked the man-page on this installation, so I made sure I would be aware of the implications. Regarding number two: If I hadn’t found the document mentioned above, I would have been presented with the message No reconstruct in /bin:/sbin:/usr/bin; the man-page holds no clue where the command is located. The typical *NIX reflex su - cyrus, does not work either. First, there is no user account named “cyrus”; second, the existing “cyrusimap” account, can’t log in, thus one cannot change into that user-context.

But, since I knew where the cyrus commands are located, I used the following sequence of commands from the administrative user-context (Actually, not so fast young padwan! The fact that these commands worked for me does not mean that they will work for you, or the state of your mailboxes, respectively. Make sure your backup is current and readable! On with the regular scheduled program):


$ sudo -u cyrusimap /usr/bin/cyrus/bin/reconstruct -r -f user/[mailboxname]
$ sudo -u cyrusimap /usr/bin/cyrus/bin/cyrus-quota -f

(You obviously have to replace [mailboxname] with the actual name of a mailbox-folder.) Lo and behold, everything works peachy again.

BTW: I have no idea whatsoever, what the -i option in the above mentioned document does, the man-page has no indication either.

Technorati Tags: , , , ,