procmail
[Top] [All Lists]

Re: procmail, sendmail, directories, whatever

2000-10-15 19:01:10
dattier(_at_)panix(_dot_)com writes:
Philip suggested to jello,
...
<script to create all of the directories /var/mail/[a-z]/[a-z]>
...
Would it not perhaps be better to have only the directories needed for
existing usernames?

#!/bin/sh
cd /var/mail
sed 's-\(.\)\(.\).*-\1/\2-' /etc/passwd | uniq | \
while read dir
do
   test -d $dir || mkdir -p $dir
done
chmod 755 ?
chmod 1777 ?/?

You should sort the list before piping it to uniq as the password file
isn't guaranteed to be sorted.  Or just use "sort -u" instead of uniq.


The procedure for creating new accounts thereafter could include
similar code:
...

This is the problem: depending on how accounts are administered, there
might not be a 'hook' where this code could be inserted.  For example,
the "adduser" program that comes with OpenBSD has no standard way to run
a given program upon account creation.


Philip Guenther

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

<Prev in Thread] Current Thread [Next in Thread>