This page describes the configuration of Courier POP3/IMAP including authlib and maildrop for use with PostfixAdmin.
/etc/authlib/authdaemonrc
authmodulelist="authmysql"
authmodulelistorig="authuserdb authpam authpgsql authldap authmysql authcustom authpipe"
daemons=5
authdaemonvar=/var/run/authdaemon.courier-imap
DEBUG_LOGIN=0
DEFAULTOPTIONS=""
LOGGEROPTS=""
The first line (authmodulelist) is the most interesting one, you can probably leave the other lines in their default values. Of course you'll need "authpgsql" if you use PostgreSQL ;-)
Note that maildrop needs access to the directory containing the authlib socket (see authdaemonvar) - maybe you need to adjust the directory permissions.
/etc/authlib/authmysqlrc
MYSQL_SERVER localhost
MYSQL_USERNAME mail-courier
MYSQL_PASSWORD topsecret
MYSQL_SOCKET /var/run/mysql/mysql.sock
MYSQL_OPT 0
MYSQL_DATABASE postfix
MYSQL_USER_TABLE mailbox
MYSQL_CLEAR_PWFIELD password # if you use cleartext passwords - or -
# MYSQL_CRYPT_PWFIELD password # if you use encrypted passwords
MYSQL_UID_FIELD '20000'
MYSQL_GID_FIELD '100'
MYSQL_LOGIN_FIELD username
MYSQL_HOME_FIELD '/var/vmail/' as home
MYSQL_NAME_FIELD name
MYSQL_MAILDIR_FIELD maildir
MYSQL_QUOTA_FIELD concat(quota,'S')
MYSQL_WHERE_CLAUSE active=1
Not too interesting here - nearly all config settings (except maybe the allowed password encryption methods) are independent from the PostfixAdmin configuration.
/etc/mail/maildrop/maildroprc
# parameters: (for foo+test@example.com)
# test foo+test@example.com foo example.com
# EXT Envelope-To Localpart Domain
# $1 $2 $3 $4
EXTENSION=$1
ENVELOPETO=$2
TOMAILBOX=$3
TODOMAIN=$4
# if you want a per-domain delivery log
# test -d "/var/vmail/$TODOMAIN" || mkdir "/var/vmail/$TODOMAIN"
# logfile "/var/vmail/$TODOMAIN/maildrop.log"
# create maildir if it doesn't exist
MAILDIR=$HOME$DEFAULT
test -d "$MAILDIR"
# check if dir exist
if ($RETURNCODE != 0)
{
# log "date
creating maildir $MAILDIR"
mkdir -p $MAILDIR
# create dirs with parents
rmdir $MAILDIR
# remove dir for init
/usr/bin/maildirmake $MAILDIR
# create maildir
}
to "$MAILDIR"
(the "create maildir" section probably does too much, but it works...)
master.cf
maildrop unix - n n - - pipe
flags=DRhu user=vmail argv=/usr/bin/maildrop -w 90 -d ${user}@${nexthop} ${extension} ${recipient} ${user} ${nexthop}
main.cf
maildrop_destination_recipient_limit = 1