Simon Loewen wrote: > 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 ../.. >
Oddly it did not work properly because the Maildir and Password is not set (shown below) and the account cannot log in via webmail. There are some authentication failures from authtest # authtest [email protected] Authentication succeeded. Authenticated: [email protected] (uid 7200, gid 7200) Home Directory: /var/spool/imap/users/0000001/simontest.com/ Maildir: (none) Quota: (none) Encrypted Password: (none) Cleartext Password: (none) Options: (none) Here the password I originally set was "q". # authtest [email protected] q Authentication FAILED: Operation not permitted # authtest [email protected] q 1 Authentication FAILED: Operation not permitted # authenumerate [email protected] 7200 7200 /var/spool/imap/users/0000001/simontest.com/ ------------------------------------------------------------------------------ _______________________________________________ courier-users mailing list [email protected] Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
