Quote:
|
Originally Posted by gfdos.sys 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" |
That's incorrect - '.' matches any single character.
Quote:
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 |
You regex will work, though there's a difference between yours and the one you got from the examples.
Their example:
Code:
's/^INBOX\.(.+)/$1/'
Means "match, at the beginning of the string (^) the word "INBOX" followed by a literal '.' (\ escapes the '.') followed by one or more characters (.+). Replace this with the match for "one or more characters"
So INBOX.foo maps to foo, and INBOX.bar maps to bar. However, INBOXFOO still maps to INBOXFOO - which is where your example breaks:
Code:
's/^INBOX.(.*)/$1/'
Means "match, at the beginning of the string (^) the word "INBOX" followed by any character, followed by zero or more characters (.*). Replace this with the match for "zero or more characters"
So, INBOX.foo maps to foo - but INBOXfoo maps to oo, and INBOXf maps to the empty string.
Not something that you'll likely hit (the domain of folder names that will break you is pretty small), but it could haunt you.