[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [imapsync] --delete2folders --delete2foldersonly


From Gilles LAMIRAL <gilles dot lamiral at laposte dot net>
Subject Re: [imapsync] --delete2folders --delete2foldersonly
Date Sat, 15 Jan 2011 04:39:34 +0100

Hello Michele,

> Ok I'll try with an example. Actually I have 2 different scenarios... now...

Good.

> Scenario 1 (an most important):
> **********
> 
> Let say I have following mailboxes on Host1:
> A
> B
> C
> 
> and on Host2 just:
> ETH OLD
> 
> Note: actually Host2 is already a productive server where some people have more or less mailboxes,
> so I decided to move all these into the mailbox "ETH OLD" which has *not* to be deleted during the syncs.

If I were one of your user I would be hungry: don't touch my folder names,
I use them to filter. And I would be hungry that my newly folders are removed
because they're not in this new "ETH OLD".

> My goal is to have all mails of Host1 migrated to Host2 without deleting "ETH OLD", so:
> A
> B
> C
> ETH OLD
> 
> AND I want to execute the sync-script at lease 2 times: the first time to do a kind of "pre-sync" in "background" to speedup then the real sync (the second time) at the "d"-day.
> 
> So for this I'm using following options:
> 
> imapsync \
>    --ssl1 --host1 $host1 --user1 $username1 --password1  PWCHANGED \
>    --ssl2 --host2 $host2 --user2 $username2 --password2  PWCHANGED \
>    --delete2 --expunge2 --delete2folders \
>    --noauthmd5 \
>    --subscribe \
>    --useheader 'Message-ID' \
>    --skipsize
> 
> and as you can imagine this will remove also "ETH OLD". 

Yes.

> What can I do? Can I use somehow the new option --delete2foldersonly? Something like !/^ETH OLD/? ;-)

No it doesn't work. I've just added an option for you:

--delete2folders: delete folders in host2 that are not in
                         host1 server. For safety, please try it like this (safe):
			 --delete2folders --dry --justfolders --nofoldersizes
--delete2foldersonly <regex>: delete only folders matching regex.
--delete2foldersnot  <regex>: do not delete folders matching regex.


Other thing,
  --skipsize --useheader 'Message-ID' --noauthmd5
are default options now.




-- 
Au revoir,                             09 51 84 42 42
Gilles Lamiral. France, Baulon (35580) 06 20 79 76 06