configuring dbmail

So, in my last post, I mentioned that I’m running out of inodes with Maildir.  I’ve decided to try out dbmail to see if I can get decent performance putting my email into MySQL, then.  Hopefully it’ll work. :)

I built dbmail pretty normally:

./configure --prefix=/opt/dbmail/2.2.11 --sysconfdir=/etc/dbmail \
  --mandir=/usr/local/man/ --with-mysql --with-sieve

and, after creating the database + setting grants and whatnot, created the tables.

[root@myhost dbmail-2.2.11]# mysql dbmail < sql/mysql/create_tables.mysql

Then, tried to create myself:

[root@myhost dbmail-2.2.11]# dbmail-users -a sauer -P
Jul 23 15:46:43 myhost dbmail-users[24347]: Error:[sql] dbmysql.c,db_mysql_check_collations(+138): collation mismatch, your MySQL configuration specifies a different charset than the data currently in your DBMail database.
Failed. Could not connect to database (check log)
Command failed.

Well, that sucks.  After some investigation, I found that the default collation on the dbmail database was latin-1, but the tables were being created in utf8-general.  So, I had to change the default collation on the database to match the tables for the command to work (which is weird, but whatever).  This is where I admit that I’m not sure how to do it with the mysql command line.  It’d be easy to find with Google, but I just fired up PHPMyAdmin, went to the dbmail database, clicked on “operations”, and changed the default collation to match the one the tables were using.  Sometimes the pointie-clickie thing is actually useful. :)

[root@myhost dbmail-2.2.11]# dbmail-users -a sauer -P
Adding INBOX for new user... ok.
Done
sauer:x:4:0:0.00:0.00:

Hooray!  On to further configuration.