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
- postfix setup with vmailbox must be setup first.
- Install packages courier-authlib-userdb, courier-imap-ssl, courier-pop-ssl
- mkdirs
# mkdir /etc/courier
# touch /etc/courier/userdb
# chmod 600 /etc/courier/userdb
- Turn on the userdb authentication scheme. Edit
/etc/courier/authdaemonrc
set authmodulelist="authuserdb"
- Decide which daemons to start.
Setup per email
- Determine uid and gid of vmail This will be the vmail user setup as part of postfix initial setup.
# id vmail
uid=1002(vmail) gid=1002(vmail) groups=1002(vmail)
In the above example, the id is 1002.
- Add to userdb
# userdb "testuser@example.com" set home=/var/mail/vhosts/example.com/testuser \
mail=/var/mail/vhosts/example.com/testuser 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/
- set password
# userdbpw | userdb "testuser@example.com" set systempw
it will prompt you for a password
- rebuild userdb
# makeuserdb
/etc/courier/userdb.dat
will be updated
- reload services
# service courier-authdaemon restart
* Stopping Courier authentication services authdaemond
...done.
* Starting Courier authentication services authdaemond
...done.
Notify the user their account is ready. Note that their username is their FULL email address.