#!/bin/bash export HOME_DIR=`(cd $(dirname $0); pwd)` . $HOME_DIR/common.sh || exit 1 printUsage() { cat >&1 </dev/null 1>&1 echo -n "Confirm that all modules loaded successfully by pressing ENTER:" read in echo "Changing permissions so that only the user mailusers (& root) can talk to the authdaemon ..." chmod 700 /usr/local/var/spool/authdaemon || exit 1 # as authdaemon runs as root, root and not mailusers should own these files echo "Changing ownership and permissions for /usr/local/etc/authlib/* ..." chown root:root /usr/local/etc/authlib/* || exit 1 chmod 600 /usr/local/etc/authlib/* || exit 1 echo "Starting authdaemond ..." /etc/init.d/authdaemond start || exit 1 sleep 3 echo "Running 'authtest root' ..." authtest root || exit 1 echo "Running authenumerate (this should show all local accounts) ..." authenumerate echo -n "Confirm that it works by pressing ENTER:" read in echo "Test authlib and authdaemond by runing 'authtest ' on another console." echo -n "Confirm that it works by pressing ENTER:" read in # configure authmysql # - comment out MYSQL_SERVER and MYSQL_PORT and set MYSQL_SOCKET to /tmp/mysql.sock # - set MYSQL_USERNAME to "mailusers" and MYSQL_PASSWORD to what you have chosen before # mailusers has only SELECT privileges in the database mailusers # - set MYSQL_DATABASE to "mailusers" # - uncomment MYSQL_QUOTA_FIELD echo "Applying patch authmysqlrc.patch ..." sed s/MYSQL_MAILUSERS_PWD/$MYSQL_MAILUSERS_PWD/ $PATCHES_DIR/authmysqlrc.patch | (cd /usr/local/etc/authlib && patch) || exit 1 echo "Overwriting /var/qmail/supervise/qmail-smtpd/run ..." cp $SCRIPTS_DIR/var_qmail_supervise_qmail-smtpd_run_COURIERPASSWD \ /var/qmail/supervise/qmail-smtpd/run || exit 1 echo "" echo "CONGRATULATIONS! authlib & authdaemond were successfully installed." # END