Steve Jacobson writes:
I have the following script running in /etc/cron.hourly on my system. It queries ldap for the list of valid users. My /etc/ldap.conf sets up the default behavior for the query. It also sets up spam and ham Maildirs for spamassassin to use.
-steve j

=snip= Thanks Steve, nice solution for me.... I have sent in my modified version for anyone else interested. I had to add the dc into the ldap search to get any results on my system and cut out the @domain.com from the email address to get directory names. -Matt :: Modified version

#!/bin/bash for i in `ldapsearch -x -b "dc=mydomain,dc=com,dc=au" mail | grep ^mail | cut -f2 -d: | cut -f2 -d" " | cut -f1 -d@ | sort | uniq | grep ^[a-z]` ; do
if [ ! -d /hometest/${i} ] ;
  then
     mkdir -p /hometest/$i
     chown vmail:vmail /hometest/$i
fi

if [ ! -d /hometest/${i}/Maildir ] ;
  then
     /usr/bin/maildirmake /hometest/${i}/Maildir
     /usr/bin/maildirmake /hometest/${i}/Maildir/.spam
     /usr/bin/maildirmake /hometest/${i}/Maildir/.spam.spam
     /usr/bin/maildirmake /hometest/${i}/Maildir/.spam.ham
     chown -R vmail:vmail /hometest/${i}/Maildir
fi done



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to