View Single Post
  #54 (permalink)  
Old 04-11-2006, 09:39 AM
gfdos.sys gfdos.sys is offline
Senior Member
 
Posts: 65
Exclamation Note!!!

Quote:
Originally Posted by gfdos.sys
The answer to this comes from the imapsync FAQ (http://www.linux-france.org/prj/imapsync/FAQ), as I was just trying to figgure this out my self:


Q. Give examples about --regextrans2

R. Examples:

1) To remove INBOX. in the name of destination folders:
--regextrans2 's/^INBOX\.(.+)/$1/'

2) To sync a complete account in a subfolder called FOO:
--regextrans2 's/^INBOX(.*)/INBOX.FOO$1/'

PLEASE NOTE: in practice this might be a combination of the two:
This is what I just came up with that worked-- the first one up there doesnt seem to work.... but combining the "spirit" of number 2 above with #1 I have found this(below) DOES work:

Code:
imapsync --nosyncacls --syncinternaldates 
--regextrans2 's/^INBOX.(.*)/$1/' 
--host1 $host1 --user1 "$user" --password1 "$p1" 
--host2 $host2 --user2 "$user" --password2 "$p1"
note:the "." is a concatiator symbol in a "regular expression" but in this case we want all instances of:
INBOX.* = *
But still want
INBOX = INBOX

so:
INBOX
INBOX.Drafts
INBOX.Sent
INBOX.Trash

should go to
INBOX
Drafts
Sent
Trash

if the "." is in the wrong place it tries to make INBOX* = * and then
you get:
/
Drafts
Sent
Trash

and that / = ugly mess, as none of your inbox messages make it into the inbox
Reply With Quote