Subject: bulk transfer with differing capabilities

From: Ben Liblit <[email-masked]>
Date: Mon, 31 Jan 2005 18:04:34 -0600

I'd like to bulk transfer a folder hierarchy from one IMAP server to 
another.  Many of the folders contain both messages and subfolders.  The 
source IMAP server supports this, obviously, but the destination IMAP 
server does not.

I know about "mailutil transfer", but it doesn't seem usable in this 
context.  It reports an error and halts the first time it tries to put 
messages into a folder that has already been created as a "directory" 
with subfolders.

It seems I need one of two things.  Either I need a modified "mailutil 
transfer" that gracefully adapts to this situation or else I need a 
distinct tool which "homogenizes" folders on the source server first.  I 
imagine something with moves "foo" messages into, say, "foo/general" if 
folder "foo" also has subfolders.

Do any of you already have something for dealing with this situation?
-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Mon, 31 Jan 2005 16:11:29 -0800 (Pacific Standard Time)

On Mon, 31 Jan 2005, Ben Liblit wrote:
> I know about "mailutil transfer", but it doesn't seem usable in this context. 
> It reports an error and halts the first time it tries to put messages into a 
> folder that has already been created as a "directory" with subfolders.

Did you try various "-merge" options in "mailutil transfer"?

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

---

From: Ben Liblit <[email-masked]>
Date: Mon, 31 Jan 2005 18:25:16 -0600

> Did you try various "-merge" options in "mailutil transfer"?

Neither "-merge prompt" nor "-merge append" seemed applicable.  I tried 
"-merge suffix=.alt" but it did not work.  Suppose I have source folders 
"foo" and "foo/bar", with messages in both.  Near as I can tell from the 
"-verbose" output, the order of events is something like the following:

1. Create destination folder "foo" as a file, not a directory.
2. Copy messages from source folder "foo" to destination folder "foo".
3. Attempt to create destination folder "foo/bar".
4. Receive error from destination server.
5. Attempt instead to create destination folder "foo/bar.alt".
6. Again, receive error from destination server.
7. Prompt the user for an alternate name.

Without "-merge suffix=.alt", the same events occur up through step 4. 
In neither case am I able to complete the transfer without manual human 
intervention.  :-(

---

From: Mark Crispin <[email-masked]>
Date: Mon, 31 Jan 2005 16:33:28 -0800 (Pacific Standard Time)

On Mon, 31 Jan 2005, Ben Liblit wrote:
> Without "-merge suffix=.alt", the same events occur up through step 4. In 
> neither case am I able to complete the transfer without manual human 
> intervention.  :-(

You didn't say before that you wanted "without manual human intervention."
Otherwise, I would use "-merge prompt" and choose an alternative name.

The whole issue is that there is no well-defined means to copy mailboxes 
from "dual-use" mail stores to regular mail stores.

-- Mark --

---

From: Ben Liblit <[email-masked]>
Date: Mon, 31 Jan 2005 18:39:24 -0600

> You didn't say before that you wanted "without manual human intervention."

One might have read that into my characterization of this as a "bulk 
transfer".  But no matter.  I hereby clearly and explicitly state that I 
want to perform this transfer "without manual intervention".

> from "dual-use" mail stores to regular mail stores.

For each folder "foo" with both messages and subfolders, move messages 
into a new "foo/general" subfolder.  That's a well-defined conversion. 
It's not the only possible conversion, but I'm flexible.  If anyone on 
this list has an existing homogenization tool or combined 
homogenize-during-transfer tool that uses some other reasonable 
conversion strategy, I'd be happy to hear about it.

[What if "foo/general" already exists?  Then try "foo/general.1", 
"foo/general.2", etc.  Or abort with an error.  As I say, I'm flexible. 
  Any reasonable scheme will probably suffice.]

---

From: tomas pospisek <[email-masked]>
Date: Tue, 1 Feb 2005 08:49:20 +0100 (CET)

On Mon, 31 Jan 2005, Ben Liblit wrote:

> another.

Have you had a look at mailsync?
*t

--
-----------------------------------------------------------------------
     Tomas Pospisek
     http://sourcepole.com -   Linux & Open Source Solutions
------------------------------------------------------------------------

---

From: Ben Liblit <[email-masked]>
Date: Tue, 01 Feb 2005 02:14:37 -0600

> Have you had a look at mailsync?

I see nothing in the documentation to suggest that it can deal with one 
server that supports folders with messages and subfolders and a second 
server which does not.  In fact, the WHATSNEW file notes that as of 
release 5.0.0

     it should be possible to sync stores which contain folders with
     messages _and_ submailfolders. However if two stores do not _both_
     allow messages _and_ subfolders in folders at the same time,
     submailboxes will be created first and messages in folders that
     contain subfolders will no be synchronized!

That reads as a pretty clear statement that mailsync cannot adapt my 
existing mail store to conform to the limited capabilities of the 
destination server.

If I find a different tool that can automatically "homogenize" my 
folders on the source server first, perhaps then I'll use mailsync for 
the bulk transfer.  So thanks, Tomas, for bringing it to my attention. 
But my search continues....