l�r, 07.05.2005 kl. 06.00 skrev zamri:

> Thanks Tony for the answer. Could you or anybody share the script. My
> system uses mbox-style with uw-imapd as the imap server and postfix as the
> MTA.

There's no way I can help you, my script's for Courier IMAP at a site
where all the users are in LDAP.

But FWIW I attach it anyway.

--Tonni

-- 
Nothing sucksseeds like a pigeon without a beak ...

mail: [EMAIL PROTECTED]
http://www.billy.demon.nl
 
They'll love us, won't they? They feed us, don't they? ...
#!/bin/sh
# Script called by user vmail to make users' maildirs if they don't exist.
# The script is called out of cron from vmail's crontab.
# T. Earnshaw 21-07-04, 15-9-04
 
for ou in beheerders directie docenten leerlingen personeel;do
  for uid in `/usr/local/bin/ldapsearch -x -LLL -b "ou=$ou,dc=barlaeus,dc=nl" uid | awk -F: '/uid/ { print $2 }'`;do
    if [ "`/usr/local/bin/ldapsearch -x "uid=$uid" | awk '/uid:/ { print  $2 }'`" != "" ]; then
        homedir=`/usr/local/bin/ldapsearch -x -D "cn=proxy,dc=barlaeus,dc=nl" -w password \
        "uid=$uid" | awk '/mailMessageStore:/ { print  $2 }' | awk -F/ '{ print "/"$2"/"$3"/"$4"/"$5 }'`
    fi
    if [ ! -d $homedir/Maildir ];then
      mkdir -p $homedir
      /usr/local/bin/maildirmake $homedir/Maildir/
      cat /home/vmail/vmailhome/data/welkom.txt | mail -s Welkom [EMAIL PROTECTED]
      echo "$homedir/Maildir/ aangemaakt" | mail -s "Nieuwe maildir aangemaakt" root
    fi
  done
done

Reply via email to