Cheers Edna.

I modified the script to include the userdb command set-up.  I shall add
the usual [ -f ] tests for files, error handling & passing of variables
from CLI later.

1) Does this script look correct?
2) Will userdb with imappw only allow access to IMAP, whereas
   systempw might allow access to webmail and some form of control
   panel that I have yet to add (e.g interface for SpamAssasin
   controls on a per user basis)?

#!/bin/sh
#
# Variables
# ACT = Account number  e.g 1234
# TLD = domainname      e.g simontest.com
# USR = username        e.g simon
#
# Path amended to include userdb userdbpw makeuserdb
PATH=$PATH:/usr/local/sbin

###############################################
#
#  Userdb Stuff
#
###############################################
# Add user to userdb set password and make the dB
#

userdb "$TLD/$...@$tld" set \
             home=/var/spool/imap/users/$ACT/$TLD/$USR \
             uid=7200 gid=7200

userdbpw | userdb "$TLD/$...@$tld" set imappw

makeuserdb


###############################################
#
#  Maildir Stuff
#
###############################################

cd /var/spool/imap/users

mkdir $ACT
chown vmail:vmail $ACT
cd $ACT
mkdir $TLD
chown vmail:vmail $TLD
cd $TLD

# Now make the home directory and maildirs
mkdir $USR
cd $USR
/usr/lib/courier/bin/maildirmake Maildir
cd Maildir
/usr/lib/courier/bin/maildirmake .Drafts
/usr/lib/courier/bin/maildirmake .Sent
/usr/lib/courier/bin/maildirmake .Trash
echo "INBOX" > courierimapsubscribed
echo "INBOX.Sent" >> courierimapsubscribed
echo "INBOX.DRAFTS" >> courierimapsubscribed
echo "INBOX.Trash" >> courierimapsubscribed
echo "INBOX.Spam" >> courierimapsubscribed
cd ../..
chown -R vmail:vmail $USR
cd


------------------------------------------------------------------------------
_______________________________________________
courier-users mailing list
courier-users@lists.sourceforge.net
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to