Courier IMAP Setup

courier-imap pop3 and imap daemon with userdb setup notes

Published: Saturday, 26 February 2011
Last modified: Tuesday, 3 December 2013
mail courier imap

Courier IMAP is a pop3 and imap daemon.

Userdb authentication setup

I’m using userdb for authentication. There are other schemes you can use such as PAM, MySQL or Postgres.

userdb is a disk based authentication, similar to standard passwd files.

Initial Setup

# mkdir /etc/courier
# touch /etc/courier/userdb
# chmod 600 /etc/courier/userdb
set authmodulelist="authuserdb"

Setup per email

# id vmail
uid=1002(vmail) gid=1002(vmail) groups=1002(vmail)

In the above example, the id is 1002.

# userdb "" set home=/var/mail/vhosts/ \
  mail=/var/mail/vhosts/ uid=1002 gid=1002

After this command you should see a new entry in /etc/courier/userdb The mail parameter is used so it is not defaulted to $home/Maildir/

# userdbpw | userdb "" set systempw

it will prompt you for a password

# makeuserdb

/etc/courier/userdb.dat will be updated

# service courier-authdaemon restart
 * Stopping Courier authentication services authdaemond
 * Starting Courier authentication services authdaemond

Notify the user their account is ready. Note that their username is their FULL email address.

Courier IMAP Setup