I am interested in using Courier to run a mail host for many domains.
I want to use shell scripts to set things up, as opposed to using the
web administration tool that comes with Courier.  Userdb will be the
only authentication method at the present time.

The following set of scripts is close, but no cigar.  My most
noticeable problem is that Courier does not accept incoming email
(user unknown), probably as a result of mis-understanding how to set
up the directory structure for userdb virtual domains.

Any problems with setting up Courier as user courier, and then running
all the virtual domains also under user courier.  Or should those
functions be split between different users ?

I seem to need to set up both an account for the popmail account, and
the real address, since some real address names will not be acceptable
in an email reader.  These two accounts both map into the same
Maildir.  True or false ?




This package is being installed on a Debian 2.2 (Potato) machine.

apt-get --assume-yes install apache
apt-get --assume-yes install libgdbmg1-dev
apt-get --assume-yes install ispell
apt-get --assume-yes install iamerican
apt-get --assume-yes install expect5.31

adduser --quiet --disabled-password --gecos "courier" courier

cp /usr/local/bin/create_courier_mta_2 /home/courier
cp /usr/local/src/courier-0.37.0.tar.gz /home/courier

chown courier.courier /home/courier/courier-0.37.0.tar.gz
chown courier.courier /home/courier/create_courier_mta_2



Then run this script (create_courier_mta_2) as user courier, in /home/courier.

tar -zxvf courier-0.37.0.tar.gz
cd courier-0.37.0
./configure --with-mailuser=courier \
             --with-mailgroup=courier \
             --without-certdb \
             --without-authpam \
             --without-authldap \
             --without-authpwd \
             --without-authmysql \
             --without-authpgsql \
             --without-authvchkpw \
             --without-authcram \
             --without-authshadow \
             --without-authcustom


#  run configure first without this workaround option
#  then rerun with option
#            --enable-workarounds-for-imap-client-bugs


./configure --with-mailuser=courier \
             --with-mailgroup=courier \
             --without-certdb \
             --without-authpam \
             --without-authldap \
             --without-authpwd \
             --without-authmysql \
             --without-authpgsql \
             --without-authvchkpw \
             --without-authcram \
             --without-authshadow \
             --without-authcustom \
             --enable-workarounds-for-imap-client-bugs

make
make check



Then return to user root, and run

cd /home/courier/courier-0.37.0
make install
make install-configure

cp /usr/lib/courier/libexec/courier/webmail/webmail /usr/lib/cgi-bin
mkdir /var/www/webmail
cp /usr/lib/courier/share/sqwebmail/images/* /var/www/webmail/

perl -i.bak -pe "s/^BrowserMatch \"MSIE.*/BrowserMatch \"MSIE\" 
nokeepalive downgrade-1.0 force-response-1.0
/;" /etc/apache/srm.conf

perl -i.bak -pe "s/^ESMTPDSTART=NO/ESMTPDSTART=YES/;" 
/usr/lib/courier/etc/esmtpd
perl -i.bak -pe "s/^POP3DSTART=NO/POP3DSTART=YES/;" /usr/lib/courier/etc/pop3d

perl -i.bak -pe "s/^postmaster:/postmster: mdm\@internet-tools.com/;" 
/usr/lib/courier/etc/aliases/system

/usr/lib/courier/sbin/makealiases

perl -i.bak -pe "s/^mail.info.*//;" /etc/syslog.conf

echo `hostname -f` >/usr/lib/courier/etc/locals
echo "localhost" >>/usr/lib/courier/etc/locals

echo "american" >/usr/lib/courier/share/sqwebmail/html/en-us/ISPELLDICT


Set up virtual domains

Make usr:lib:courier:etc:esmtpacceptmailfor.dir:internet-tools.com and
      usr:lib:courier:etc:hosteddomains:internet-tools.com

contain

internet-tools.com
.internet-tools.com

Make home:courier:internet-tools.com:.courier
contain

[EMAIL PROTECTED]


Run the following script to set up Maildir for the users of a virtual domain.


mkdir -p /home/courier/internet-tools.com/harry
/usr/lib/courier/bin/maildirmake /home/courier/internet-tools.com/harry/Maildir
chown -R courier.courier /home/courier/internet-tools.com/
/usr/lib/courier/sbin/userdb [EMAIL PROTECTED] set 
home=/home/courier/internet-tools.com/harry 
mail=/home/courier/internet-tools.com/harry/Maildir uid=courier 
gid=courier quota="99000000S,8000C"
echo "secret" | /usr/lib/courier/sbin/userdbpw | 
/usr/lib/courier/sbin/userdb [EMAIL PROTECTED] set systempw
#
/usr/lib/courier/sbin/userdb m1000 set 
home=/home/courier/internet-tools.com/harry 
mail=/home/courier/internet-tools.com/harry/Maildir uid=courier 
gid=courier quota="99000000S,8000C"
echo "secret" | /usr/lib/courier/sbin/userdbpw | 
/usr/lib/courier/sbin/userdb m1000 set systempw


mkdir -p /home/courier/internet-tools.com/mdm
/usr/lib/courier/bin/maildirmake /home/courier/internet-tools.com/mdm/Maildir
chown -R courier.courier /home/courier/internet-tools.com/
/usr/lib/courier/sbin/userdb [EMAIL PROTECTED] set 
home=/home/courier/internet-tools.com/mdm 
mail=/home/courier/internet-tools.com/mdm/Maildir uid=courier 
gid=courier quota="99000000S,8000C"
echo "secret2" | /usr/lib/courier/sbin/userdbpw | 
/usr/lib/courier/sbin/userdb [EMAIL PROTECTED] set systempw
#
/usr/lib/courier/sbin/userdb m2000 set 
home=/home/courier/internet-tools.com/mdm 
mail=/home/courier/internet-tools.com/mdm/Maildir uid=courier 
gid=courier quota="99000000S,8000C"
echo "secret2" | /usr/lib/courier/sbin/userdbpw | 
/usr/lib/courier/sbin/userdb m2000 set systempw



Append

5 1-23 * * * root su -c "/usr/lib/courier/share/sqwebmail/cleancache.pl" bin

to /etc/crontab


Run this script as root

/usr/lib/courier/sbin/makeuserdb
/usr/lib/courier/sbin/makehosteddomains
/usr/lib/courier/sbin/makeacceptmailfor

#chmod 600 /home/courier/*/*/.mailfilter

#chmod 555 /home/courier/*/.courier

# remove exim init - do not want daemon
update-rc.d -f exim remove
rm /etc/cron.d/exim
rm /etc/cron.daily/exim

# set up courier init
update-rc.d courier   start 85 2 3 4 5 . stop 85 0 1 6 .
chmod +x /etc/init.d/courier



That's all I've got at the current time, and it does not work.

Comments, suggestions and critiques gladly accepted.

Thanks

mark

_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to