5. Configuring PAM

Now we need to get sure that PAM knows how to authenticate the Cyrus users

You have to create the file /etc/pam.d/imap with the following entries:

auth sufficient pam_mysql.so user=mail passwd=secret host=localhost db=mail table=accountuser usercolumn=username   passwdcolumn=password crypt=0

auth sufficient pam_unix_auth.so

account required pam_mysql.so user=mail passwd=secret host=localhost db=mail table=accountuser usercolumn=username passwdcolumn=password   crypt=0

account  sufficient       pam_unix_acct.so

The lines containing pam_unix_auth.so and pam_unix_acct.so are only needed if you are migrating from wu-IMAP to cyrus. This way the users can be authenticate with its old unix-password and its new mysql-based password

If you will use Cyrus also for POP-Service just cp /etc/pam.d/imap /etc/pam.d/pop For user that like to use also sieve, must also make a pam module for the sieve service with the following entry: cp /etc/pam.d/imap /etc/pam.d/sieve Finally if you want to use SMTP authentication you need to copy the same file: cp /etc/pam.d/imap /etc/pam.d/smtp

cp /etc/pam.d/imap /etc/pam.d/pop
cp /etc/pam.d/imap /etc/pam.d/sieve
cp /etc/pam.d/imap /etc/pam.d/smtp