* On 2002.04.02, in <[EMAIL PROTECTED]>, * "Simon White" <[EMAIL PROTECTED]> wrote: > 01-Apr-02 at 18:57, Robert Chien ([EMAIL PROTECTED]) wrote : > > Hi, > > > > I'm in the process of writing a CGI/Perl script to move > > folders from one IMAP server to another IMAP server. I would > > Err... why are you using Mutt? Why not just set up an NFS share or FTP > access, and just *copy* the files from one server to the other?
You answered this yourself.... > Or is there a specific reason you need to use an MUA to do it? I can't > think of one good reason, unless of course you don't have anything but > IMAP access to each server to either server, you mean. > in which case you're not going to be doing it > for a whole heap of users, are you? Why not? I've been in this situation (or, more accurately, postured a similar on behalf of my users). With access to one hierarchy of mboxes, I use a command like this to transfer them all to an IMAP server: cd .../path/to/folders find . -type f -print | while read folder; do directory=`dirname $folder` folder=`basename $folder` mutt -f $directory/$folder -e "push '<tag-pattern>~A<enter><tag-prefix><copy-message><kill-line>imap://SERVER/$directory/$folder<enter><enter>PASSWORD<enter><exit>'" echo echo "$directory/$folder is transferred." done It's trivial to extend that to handle multiple users, if you know their passwords. If you don't know their passwords, then it's probably possible to arrange a back-channel transfer not involving IMAP directly. For doing this between two servers *neither* of which you have access to, I don't see a way to automate it, since there's no direct means of getting the folder tree structure in mutt and passing it to a script. But if you can use another IMAP tool (or cobble your own) to get that list, you can use a similar approach. -- -D. [EMAIL PROTECTED] NSIT University of Chicago