Debian Tutorials

Debian Tutorials


Step by step tutorials showing you how to install and configure various applications and services on Debian based Linux distros.

October 2024
M T W T F S S
 123456
78910111213
14151617181920
21222324252627
28293031  

Categories


Installing Courier POP3 and IMAP services with MySql backend

Ástþór IPÁstþór IP

This tutorial assumes you already have Postfix installed with MySql backend as described in this tutorial: Installing Postfix with MySql backend and TLS

1. Install required packages

apt-get install courier-authdaemon courier-authlib-mysql courier-pop courier-pop-ssl courier-imap courier-imap-ssl

2. Make the auth daemon support MySql virtual users (pico /etc/courier/authdaemonrc)

authmodulelist="authmysql"

3. Configure courier to use MySql backend (pico /etc/courier/authmysqlrc)

MYSQL_SERVER {mysql_host}
MYSQL_USERNAME {mysql_username}
MYSQL_PASSWORD {mysql_password}
MYSQL_PORT 0
MYSQL_DATABASE {mysql_database}
MYSQL_USER_TABLE users
MYSQL_CRYPT_PWFIELD password
MYSQL_UID_FIELD 5000
MYSQL_GID_FIELD 5000
MYSQL_LOGIN_FIELD email
MYSQL_HOME_FIELD "/home/vmail"
MYSQL_MAILDIR_FIELD CONCAT(SUBSTRING_INDEX(email,'@',-1),'/',SUBSTRING_INDEX(email,'@',1),'/')
MYSQL_QUOTA_FIELD quota

4. Restart affected daemons

/etc/init.d/courier-authdaemon restart
/etc/init.d/courier-imap restart
/etc/init.d/courier-imap-ssl restart
/etc/init.d/courier-pop restart
/etc/init.d/courier-pop-ssl restart

You can now connect to your server on port 110 for pop3, 995 for pop3s, 143 for imap and 993 for imaps.

Comments 0
There are currently no comments.