I'll be looking at your code, that's both very gracious of you to post, and very exciting for us to get our hands on. Yes, zmmailbox addmessage is a wonderful method, although the similar command line method to create a folder seems abnormally slow in our test environment (2.5 to 3.5 seconds per folder create on an idle, yet powerful server).
I deduced yesterday that the -925743380 value is a date stamp, but was unable to decipher it. Comparing the message to the results of a DIR helped me get the information, but it seemed like a needless, wasted step. Sure would be nice to see a epoch time or something that just stands out as obvious.
No, batch exports doesn't give me RFC-822 content, but I have been able to CREATE an RFC-822 message based on the results, although it seems pretty easy to overwhelm the system with large exports, which is fine for my test bed, but not fine when we do it in production. One thought was creating "X" export commands, with one for the inbox, plus one for each subfolder + it's recursive subfolders (ie: INBOX:Test and INBOX:Test:Test2), with a subject line to help identify the user and folder contained within the export's returned message.
From there, POPing those out, then splitting them into RFC-822 messages adding enough fake headers to make it "kosher" so to speak, and then creating destination folders in Zimbra, then adding them in, one at a time (well, several at a time through threading, but you get my drift).
I had hoped to decode the date/time stamp in the export, as this would make the script much easier. Right now, I use an export sans messages to get the list of folders (better than DIR, since I can exclude linked conferences, which we don't want to import over and over again). Then I do the individual exports, but I'm having to run a DIR and compare the message ID... but just to get the stupid time stamp!
I've kind of put that aside, though, as I am finding that (and perhaps they've improved it slightly) IMAP access is "fairly" reliable in a controlled fashion. So the script I'm playing with now:
1) Telnets to the IMAP server and uses expect to dump a list of folders. I then parse out just folders whose path begins "INBOX/Zimbra Migration/*" as we're encouraging users to cleanup, and move only folders absolutely necessary to speed the migration.
2) Grabs each folder, one at a time into local Maildir folders. I'm ignoring any message larger than 15mb, as that seems to be the point in which imapsync, mailsync and ten thousand other sync scripts fail when talking to FirstClass.
3) Imports the mail into Zimbra.
For whatever reason, the script that works best so far in pulling data from FirstClass is not meant to work in the fashion that IMAPsync does, so the only choice is to stick it in mbox, MailDir, or "submit it" to an MTA, which of course would spawn actual message deliveries. Hence the extra step.
And no, this doesn't mitigate the requirement for users to COPY sent mail into a folder, and then UNSEND the copies. Without that step, it's hidden from IMAP. Without the prior COPY, the actual unsend will pull the message out from the recipient, if it's a local FirstClass user who still has the message laying around.
My immediate higher ups have resigned them to the facts that end users will have to take steps here, but if the bulk of the mail transfer is automated, this will help.
This seems much quicker, since I'm no longer doing ANY exports and imports, it makes the SAN guys happier since I'm no longer asking for 1tb of scratch space

and it seems "fairly" quick, which is a extra benefit, since I'd actually given up on the prospects of doing it "quick" and was resigned to it taking something closer to forever and a day.
