Managing Cyrus Mailboxes

Because CyrusImap is an all in one solution there are some new tricks for managing Cyrus based mailboxes.

Howto Rebuild a Mailbox

  1. Make sure the user has closed their email client (if they are using Mozilla/Netscape this includes any browser or other component windows).
  2. Log in to the mail server as _root_
  3. Find any processes attached to the users mailbox and kill them:
    # find /var/spool/imap/user/<username>/ -name "cyrus.*" -print -exec fuser -k {} \; 
    
  4. Reconstruct the users mailbox:
    # su - cyrus -c "./reconstruct -r user.<username>" 
    
  5. Once it has finished they should be good to go!

Fixing System I/O Errors

All Cyrus user mail directories must be manipulated via an IMAP client, not directly via the commandline with mv/rm/etc. If someone manually removes a directory then you will get I/O errors like this:

root# su - cyrus 
cyrus> ./reconstruct -r user.adam
user.adam
user.adam.Drafts: System I/O error No such file or directory

The Cyrus "user.adam.Drafts" expands to the /var/spool/imap/user/adam/Drafts directory and if you look you should find that it doesn't exist. In order to fix the problem you need to create each missing directory by hand (and make sure to remember to chown them to the cyrus user).

Restoring Mail Folders from Backup

Sometimes you need to recover mail folders from backups (either the rsync backup or from tape). If you are recovering a folder which Cyrus no longer knows about (eg. because it was deleted accidentally via an IMAP client) then you need to use the reconstruct command to tell cyrus that there is mail for it in that folder.


CategorySoftware

CyrusImapMaintenance (last edited 2003-11-04 00:09:16 by AdamShand)