Tony's ramblings on Open Source Software, Life and Photography


Cyrus Imap And Corrupted Trash Folder

I had a user who's Outlook had apparently deleted the Trash folder from the IMAP server improperly. Outlook functioned okay, but any other email client would barf. The mail client would report a "filesystem error" when you tried to access the Trash folder, and wouldn't delete anything. The server would constantly log:

IOERROR: opening /var/spool/cyrus/mail/j/user/john/Trash/cyrus.header: No such file or directory

I'd noticed the log entries a long time ago, but given that his Outlook was still working fine I didn't stress over it. Now that he's switched to Thunderbird, it became a problem.

The fix was simply to run the following on the mail server:

sudo su - 
su - cyrus
/usr/sbin/cyrreconstruct -rf user.john

If you don't use the dot separator, it would look like:

/usr/sbin/cyrreconstruct -rf user/john

It's a quick and easy fix. cyrreconstruct (or simply reconstruct on some systems) will rebuild the user's entire mail database, and can fix many different types of corruption problems.


eGroupWare + Cyrus sieve filters

I found eGroupWare sieve filters with Cyrus a little bit confusing.

It took me a while to figure out what was going on, but a little poking around inside the /etc/sieve tree finally shed some light on the subject.Initially I had set myself up as a Cyrus administrator. I thought 'hey, I'm an admin, let's make it easy to admin things.' My first notice that things were strange had to do with the way new folders in my e-mail worked. I couldn't put my finger on it, but I kept having strange things happen.

Then, just now I realized that when I removed admin from myself, all my sieve scripts disappeared from eGroupWare. It turned out that as an admin, every filter I created was GLOBALLY installed on the server and affected every e-mail account. I'm pretty sure that others don't want me sorting their mail into my boxes for them.

I had to set myself back as admin, delete my filters, then remove my admin again. This allowed me to then create filters that ended up in the proper location. All filters I created as admin went into /etc/sieve/global/ instead of /etc/sieve/t/tony/

There's a nice tidbit of documentation they don't mention. Moral of the story? Don't set your own account as a Cyrus admin.