Yeah, you're exactly right. Apologies for not reading your initial posting more closely.
There are 2 possibilities I can see here.
One is that you're giving the wrong user password to
imapsync and hence the login's failing. This what I hope is happening, because it's easy to work around.
The other is that your existing IMAP server is broken in a way that's unfortunately incompatible with the
Mail:IMAPClient.pm module used by
imapsync. The module's LOGIN command always uses IMAP literal syntax for passwords, which is completely legal under RFC 3501. But your IMAP server can't deal with this and barfs on the LOGIN. (This is why just typing the password in by hand is working -- you're using atom syntax instead of literal syntax.)
Code:
my $string = "Login " . ( $has_quotes ? $id : qq("$id") ) . " " .
"{" . length($self->Password) .
"}\r\n".$self->Password."\r\n"; I'm not sure how best to work around this second option. It might work to edit
Mail:IMAPClient.pm to read
Code:
my $string = "Login " . ( $has_quotes ? $id : qq("$id") ) . " " .
qq("$self->Password") . "\r\n";