CYRUS LIST wrote:

> Has anyone done a script to migrate folder and mail data from a foreign IMAP
> sever?
> 
> Basically, I need to automate the procedure of a client logging into both
> old and new IMAP servers, and for each folder, create the folder, and for
> each message, copy the message, recursively through the entire account.
> Auth information would be known for both sides, but may not be the same.
> 
> Kind regards,  Stuart.

While not perhaps exactly what you want, I was able to pretty quickly 
cobble together a pair of scripts in Perl using the Mail::IMAPClient 
module to go from IMAP folders to and from the mbox format. Among the 
nice things about this module is the fact that even though they didn't 
specifically code handling for ACL and Quota stuff, you can simply do an 
$imap->GETACL("user","flags"...); call -- the all-caps functions 
automatically get converted into matching statements to the imap server.

I would post my scripts, but they're not very good -- My perl-fu is weak 
and the scripts don't do things like check for invalid headers, NULs in 
the messages, etc. I'm sure a real Perl hacker has already done much 
better. :-)

Reply via email to