1. Cyrus IMAP Notes
1.1. Miscellaneous Notes
-
Quota sizes are in kilobytes, not bytes. Becareful adding large quotas, it doesn't seem to properly check for integer overflows and will overflow to a negative number!
-
To authenticate with PAM on a Linux system, create a shadow group, change the group of /etc/shadow to shadow, enable group reading of /etc/shadow, and add the cyrus user to that group.
-
The
RPMs built by
Ramiro Morales are excellent.
-
Now working with 2.1 RPMS made by
Simon Matter, which are also very nice.
1.2. Migration from mbox to Cyrus
These are notes of things I learned while setting up Cyrus IMAP 2.0.16 and 2.1.13 on Red Hat Linux 7.2.
Migrating from Berkeley-style mailboxes (used, for example, by UW-IMAP) in /var/spool/mail or /var/mail is not a trivial task. I am happy to say, however, that this migration is well-documented in
Managing IMAP. However, since it was written, there have been several releases of Cyrus IMAP which cause some of the scripts provided to not function correctly.
First of all, the Tcl-based cyradm interface is gone, replaced by a purely Perl-based interface. The addusers script in step 2 doesn't work, so I wrote a replacement that creates the users from the password database through the ApplicationNotes/NameServiceSwitch:
migrate-pw-to-cyrus2.pl. The createfolders script in step 4 no longer works because of this. I wrote a quick & dirty replacement in Perl:
createfolders.pl.
The folder subscription data can also be recreated from the output of the bsd2cyrus script, so I wrote a script that does that:
batchsubscribe.pl. Note that you should pipe the output of bsd2cyrus through sort before using this, since Cyrus seems to want the list of subscribed folders in alphabetic order. Cyrus should be stopped when you use this script.
1.3. Upgrading from Cyrus 2.0.16 to 2.1.13
NOT YET COMPLETE-
Backed-up /var/imap and /var/spool/imap (actually /home/imap on my server, because I don't have enough space in /var.
-
Make sure you've got loggined turned on, and tail -f /var/log/imapd.log to spot anomolies.
-
Dumped /var/imap/mailboxes.db to text file with /usr/cyrus/bin/ctl_mboxlist -d > mailboxes.db.txt.
-
Installed RPMS from
Simon Matter.
-
Copied RPM-installed /var/lib/imap to /var/lib/imap.orig.
-
Disabled hashimapspool in /etc/imapd.conf. The rehash commands seems to have done strange and wrong things. I didn't look at the script long enough to figure out why.
-
Copied /var/imap to /var/lib/imap.
-
Created backup/ and rpm/.
-
Restore mailboxes.db file:
-
Move imap/db to imap/db.2. The next command restores 0 records if you don't. I don't understand why.
-
su cyrus -c "/usr/lib/cyrus-imapd/ctl_mboxlist -u < mailboxes.db.txt"
-
su cyrus -c "/usr/lib/cyrus-imapd/ctl_cyrusdb -r"
-
mkdir db or move db.2 back.
-
Or not. I had problems with this, and it's not clear to me what fixed it, but eventually, I did.
==
