Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Installation

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-27-2006, 06:08 AM
Intermediate Member
 
Posts: 24
Default Imapsync migrationg to Zimbra fails

Hi all,

I've just installed Zimbra and it seems to work just fine. But my problem i migrating 20 users existing IMAP accounts to zimbra.

For some reason imapsync fails misereably on me when i try to use it.

With a --justconnect i get the following !

Here is a darwin system (Darwin Laura.local 8.8.4 Darwin Kernel Version 8.8.4: Sun Oct 29 15:26:54 PST 2006; root:xnu-792.16.4.obj~1/RELEASE_I386 i386)
with perl 5.8.8
From software : * OK imapfront ready. + stunnel
From capability : IMAP4rev1 STARTTLS
To software : * OK laura.local Zimbra IMAP4rev1 service ready
To capability : IMAP4rev1 LOGINDISABLED STARTTLS BINARY CATENATE CHILDREN ID LITERAL+ LOGIN-REFERRALS NAMESPACE QUOTA SASL-IR UIDPLUS UNSELECT

Which looks ok. But when i try to run imapsync with --authmech1 LOGIN and --noauthmd5 it fails at login with:

Read: * OK imapfront ready. + stunnel

Connect: Received this from readline: 0/OUTPUT/* OK imapfront ready. + stunnel

Banner : * OK imapfront ready. + stunnel
Sending literal string in two parts: 1 Login "the_user" {8}

then: password

Sending: 1 Login "XXXXXXXX" {8}

Sent 19 bytes
Read: 1 NO LOGIN failed

Error login : [www.webserver.com] with user [the_user] : Error sending '1 Login "the_user" {8}
password
' to IMAP: Bad file descriptor at /opt/local/bin/imapsync line 628, <> line 1.

Strangely enough. When i try to issue the login command manually "1 login "the_user" password" then i successfully logs in ?

Do anyone have any ideas or an alternate way of migrating mailboxes ?

Thanks in advance,

Lasse K. Christiansen,
Reply With Quote
  #2 (permalink)  
Old 12-27-2006, 07:46 AM
Trained Alumni
 
Posts: 193
Default

what's your entire imapsync command you are using?
Reply With Quote
  #3 (permalink)  
Old 12-27-2006, 07:57 AM
Intermediate Member
 
Posts: 24
Default This is what i use

imapsync --nosyncacls --subscribe --syncinternaldates --noauthmd5 --drop --debugimap --authmech1 LOGIN --host1 www.webserver.com --user1 new_user --password1 password --host2 other-server.com user2 new_user --password2 password

Have tried with and without SSL which gives me the same error and also tried with and without --noauthmd5. Same error.

It looks like to me (with my limited Mail-IMAPClient / imapsync) knowledge that Mail-IMAPClient delivers the "1 login "new_user" password" as two seperate entries. While my imap frontend (Linux SME E-smith 6.0 server) wants it on a single line ? Or maybe not :-)

Any help is greatly appreciated !

Lasse,
Reply With Quote
  #4 (permalink)  
Old 12-28-2006, 02:56 AM
Project Contributor
 
Posts: 116
Default

Quote:
Originally Posted by lchrist View Post

Have tried with and without SSL which gives me the same error and also tried with and without --noauthmd5. Same error.
Have you tried with PLAIN TEXT password enabled (at Zimbra admin interface) You have also to restart tomcat after setting it.
Reply With Quote
  #5 (permalink)  
Old 12-28-2006, 08:31 AM
Intermediate Member
 
Posts: 24
Default It's not the Zimbra side which is the problem (yet)

The problem does not lie with the zimbra side yet. I'm trying to get my exsting imap accounts migrated TO Zimbra.

The problem is with the existing server which is an SME E-Smith 6.0.

Regards,

Lasse,
Reply With Quote
  #6 (permalink)  
Old 12-28-2006, 12:42 PM
Zimbra Employee
 
Posts: 1,434
Default Does --ssl1 work?

Your existing IMAP server seems to be refusing plaintext LOGIN without advertising LOGINDISABLED in the CAPABILITY string. I don't think imapsync can manage an inline STARTTLS command, so your best bet is to run it with the --ssl1 option to connect to the IMAPs port (993) instead.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #7 (permalink)  
Old 12-28-2006, 01:00 PM
Intermediate Member
 
Posts: 24
Default Tried it, same result ... damn ..

Just tried it with both PLAIN and LOGIN as authentication. And both with and without --ssl1 as an option

This is the results that i'm getting !

From connection
Read: * OK imapfront ready. + stunnel

Connect: Received this from readline: 0/OUTPUT/* OK imapfront ready. + stunnel

Banner : * OK imapfront ready. + stunnel
Sending literal string in two parts: 1 Login "new_user" {8}

then: password

Sending: 1 Login "XXXXXXXX" {8}

Sent 19 bytes
Read: 1 NO LOGIN failed

Error login : [www.webserver.com] with user [new_user] : Error sending '1 Login "new_user" {8}
rockaby1
' to IMAP: Bad file descriptor at /opt/local/bin/imapsync line 628, <> line 1.


Same result both with and without SSL1 enabled ?

if i do it manually then this is the result !

laura:~ root# telnet www.webserver.com 143
Trying 7.7.7.7...
Connected to www.webserver.com.
Escape character is '^]'.
* OK imapfront ready. + stunnel
1 login "new_user" password
1 OK Logged in.


It seems as though imapsync breaks the initial login into two parts ? and if i do it manually on a "single line" i seems to be able to login just fine ?

Any pointers ?


Lasse,
Reply With Quote
  #8 (permalink)  
Old 12-28-2006, 01:22 PM
Zimbra Employee
 
Posts: 1,434
Default Should have read more closely...

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";
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!
Reply With Quote
  #9 (permalink)  
Old 12-28-2006, 02:13 PM
Intermediate Member
 
Posts: 24
Default This probably brought it a lot closer

I thought it was related to the literal method used by Mail::IMAPClient as well.

Unfortunately the passwords used are the right ones.

Tried your mod of the Mail::IMAPClient.pm but it seems at though the syntax is somewhat wrong (i'm by definition no Perl guru ... not even close). The output that i'm getting from imapsync is now

From connection
Banner : No banner
Sending: 1 Login "XXXXXXXX" ".Mail::IMAPClient=HASH(0x1925330)->Password."

Sent 62 bytes
Read: * OK imapfront ready.

Read: 1 NO LOGIN failed

Error login : [www.webserver.com] with user [new_user] : 1 NO LOGIN failed



And then the same error.

Tailing the log file on the server seem to give me not additional info

@400000004594423508bf8a44 tcpserver: ok 9640 pc-00183.structuring.dk:10.45.6.183:993 :10.45.6.182::58742
@400000004594423508d86974 2006.12.28 22:16:11 LOG5[9640:1024]: Using 'imaps' as tcpwrapper service name
@400000004594423508f505ac 2006.12.28 22:16:11 LOG5[9640:1024]: stunnel 3.22 on i386-redhat-linux-gnu PTHREAD+LIBWRAP with OpenSSL 0.9.6b [engine] 9 Jul 2001
@400000004594423508f6ab8c 2006.12.28 22:16:11 LOG5[9640:1024]: imaps connected from 10.45.6.182:58742
@4000000045944235090647a4 imapfront-auth[9641]: * OK imapfront ready.
@400000004594423509bb2c3c imapfront-auth[9641]: 1 NO LOGIN failed
@400000004594423509c559b4 2006.12.28 22:16:11 LOG5[9640:1024]: Connection closed: 42 bytes sent to SSL, 62 bytes sent to socket


But obviously i'm now not sending the right login info !

Any additional pointers are extremely welcome (and appreciated) :-)

Lasse,
Reply With Quote
  #10 (permalink)  
Old 12-28-2006, 02:44 PM
Zimbra Employee
 
Posts: 1,434
Default My perl is paged out

Would this work instead? (My perl has decayed to almost nothing at this point.)
Code:
	my $string = 	"Login " . ( $has_quotes ? $id : qq("$id") ) . " " . 
			'"' . $self->Password . '"\r\n';
It will bomb for passwords containing double-quote chars, but that's what you get from a non-perl hacker.
__________________
Bugzilla - Wiki - Downloads - Before posting... Search!

Last edited by dkarp; 12-28-2006 at 02:46 PM..
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.