Con­vert­ing from Couri­er IMAP to dove­cot is easy

I have used Couri­er IMAP at home since a long time. As I want to update a dove­cot 1.2 set­up to dove­cot 2.x, I decid­ed to first have a look at dove­cot 2.x at home.

Switch­ing from Couri­er IMAP to dove­cot is real­ly easy. I just con­fig­ured the cor­rect path to the maildir, set­up a passdb/userdb, and it was working.

The impor­tant part was the cor­rect trans­fer of the pass­words. I used already an userdb in Couri­er IMAP with MD5 pass­words. For each user it has imappw=XXX with XXX sim­i­lar to $1$abc.

This can be con­vert­ed into a dove­cot passdb/userdb line very easily:

username:{MD5-CRYPT}$1$abc::UID:GID::HOMEDIR::userdb_mail=maildir:~/path/to/maildir

The cor­re­spond­ing passdb/userdb set­tings for dove­cot are:

passdb {
   args = scheme=MD5-CRYPT username_format=%u /usr/local/etc/dovecot/dovecot.pws
   driver = passwd-file
}
userdb {
   args = username_format=%u /usr/local/etc/dovecot/dovecot.pws
   driver = passwd-file
}

Com­pared to when I had a look the last time, dove­cot is also able to use OTP as an authen­ti­ca­tion mech­a­nism now. Unfor­tu­nate­ly I did not find any doc­u­men­ta­tion how to configure/use it.

Cheap process mon­i­tor­ing (no addi­tion­al soft­ware required)

I have an old sys­tem (only the hard­ware, it runs ‑cur­rent) which reboots itself from time to time (most­ly dur­ing the dai­ly periodic(8) run, but also dur­ing a lot of com­pil­ing (por­tup­grade)). There is no obvi­ous rea­son (no pan­ic) why it is doing this. It could be that there is some hard­ware defect, or some­thing else. It is not impor­tant enough to get a high enough pri­or­i­ty that I try hard to ana­lyze the prob­lem with this machine. The annoy­ing part is, that some­times after a restart apache does not start. So if this hap­pens, the solu­tion is to login and start the web­serv­er. If the web­serv­er would start each time, near­ly nobody would detect the reboot (root gets an EMail on each reboot via an @reboot crontab entry).

My prag­mat­ic solu­tion (for ser­vices start­ed via a good rc.d script which has a work­ing sta­tus com­mand) is a crontab entry which checks peri­od­i­cal­ly if it is run­ning and which restarts the ser­vice if not. As an exam­ple for apache and an inter­val of 10 minutes:

*/10 * * * *    /usr/local/etc/rc.d/apache22 status >/dev/null 2>&1 || /usr/local/etc/rc.d/apache22 restart

For the use case of this service/machine, this is enough. In case of a prob­lem with the ser­vice, a mail with the restart out­put would arrive each time it runs, else only after a reboot for which the ser­vice did not restart.