Many thanks!!  The script rocks.  I modified it to just test a single
user with a 700Meg spool.  It converted everything in about 6 seconds.

There is only one problem that was easy to fix.  There needs to be
double quotes around the $WD on line 7.  This is 'cuz outlook users like
to put spaces in their folder names :-)

Cheers!

Bob
On Thu, 2002-10-17 at 13:54, Gordon Messmer wrote:
> On Thu, 2002-10-17 at 08:40, Robert M. Meyer wrote:
> > I installed UW-IMAP with the maildir patches on my system but there are
> > several bizarre problems.  I intend to convert to Courier (tested it on
> > a development server) but I have to convert all of my users from one
> > maildir format hierarchy to the Courier hierarchy.
> 
> I think that the attached script will convert all of your folders
> appropriately.
> 
> ----
> 

> #! /bin/sh
> 
> scan_maildirs_in () {
>     local WD=$1
>     local PREFIX=$2
>     local x
>     pushd $WD
>     for x in * ; do
>       if [ "$x" = "Maildir" -o "$x" = "new" -o "$x" = "tmp" -o "$x" = "cur" ] ; then 
>continue ; fi
>       if test -d "$x" -a -d "$x/new" -a -d "$x/tmp" -a -d "$x/cur" ; then
>           scan_maildirs_in "$x" "$PREFIX.$x"
>           newx="`echo $x | sed -e 's/\./,/g'`"
>           echo mv "$x" $homedir/Maildir/"$PREFIX.$newx"
>       fi
>     done
>     popd
> }
> 
> 
> awk -F: '{ if($3 >= 500){print $6}}' < /etc/passwd | \
>     while read homedir; do
> 
>     pushd $homedir
>     ## Don't convert this user if there's already a "Maildir" folder
>     #test -d Maildir && continue
>     ## Only convert if this user has an INBOX
>     #test -d INBOX || continue
>     echo mv INBOX Maildir
>     scan_maildirs_in $homedir
>     popd
> 
> done
-- 
Robert M. Meyer
Sr. Network Administrator
INSTALLS inc
14 Lafayette Sq, Ste 410
Buffalo, NY 14203-1904
(716)332-1451
04
(716)332-1451



-------------------------------------------------------
This sf.net email is sponsored by: viaVerio will pay you up to
$1,000 for every account that you consolidate with us.
http://ad.doubleclick.net/clk;4749864;7604308;v?
http://www.viaverio.com/consolidator/osdn.cfm
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to