I have seen the scripts suggested but they fall short of setting the right
permisions, you can try out this below.
#!/bin/bash
for i in `awk -F: '{print $1}' /etc/passwd`
do
/var/qmail/bin/maildirmake /home/$i/Maildir
chown $i:users /home/$i/Maildir
echo /home/$i/Maildir/ >~/.qmail
chown -R $i:users /home/$i
done
On Thursday 30 October 2003 12:31, Peter C. Ndikuwera wrote:
> You might want to use "maildirmake" instead of "mkdir" in all the
> commands below.
>
> On Thu, 2003-10-30 at 12:29, Peter C. Ndikuwera wrote:
> > simple.
> >
> > mkdir /home/staff/*/Maildir
> >
> > or if they're really many then,
> >
> > ----------------
> > #!/bin/tcsh (Yes, I prefer this to bash sometimes)
> > foreach i (/home/staff/*)
> > mkdir $i/Maildir
> > end
> > --------------
> >
> > or,
> >
> > find /home/staff/ -type d -maxdepth 1 -exec mkdir \{\}/Maildir \;
> >
> > <grin>
> >
> > Peter
> >
> > On Thu, 2003-10-30 at 12:09, Joseph Mpora wrote:
> > > Hullo All,
> > >
> > > Does anyone know how to replicate a folder in multiple locations
> > >
> > > Eg. under /home/staff/<many usernames>
> > >
> > > I want to create a Maildir in each of these home folders. Is there a
> > > single command I can use instead of doing a mkdir
> > > /home/staff/<username>/Maildir for each of them?
> > >
> > > Joseph
> > >
> > >
> > >
> > > ---------------------------------------------
> > > This service is hosted on the Infocom network
> > > http://www.infocom.co.ug
> >
> > ---------------------------------------------
> > This service is hosted on the Infocom network
> > http://www.infocom.co.ug
>
> ---------------------------------------------
> This service is hosted on the Infocom network
> http://www.infocom.co.ug
--
Senior Systems Engineer,
Infocom Ltd,
P. O. Box 8373,
Kampala - Uganda.
Tel: +25675243879
Fax: +25641342192
---------------------------------------------
This service is hosted on the Infocom network
http://www.infocom.co.ug