imapsync: error when migrate from Exchange

Looking to migrate to ZCS? Ask here. Got a great tip or script that helped you migrate? Post it here.
Post Reply
elijah_y_o
Posts: 2
Joined: Fri May 26, 2023 11:33 am

imapsync: error when migrate from Exchange

Post by elijah_y_o »

Hello! I trying to use this command for imapsync to migrate mailboxes from Exchange 2019 server to Zimbra 9.0.0_GA_4485.NETWORK server:

imapsync --host1 my.exchange.server --user1 "exampleuser@exchange.kz" --authuser1 "exampleadmin@exhange.kz" --password1 *adminpass1* --authmech1 Gssapi --host2 my.zimbra.server --user2 "exampleuser@zimbra.kz" --authuser2 "exampleadmin@zimbra.kz" --password2 *adminpass2* --authmech2 PLAIN
and after this I get this message:

Here is imapsync 2.229 on host my.zimbra.server , a linux system with 17.4/23.2 free GiB of RAM, 26.69% used by processes.
with Perl 5.26.3 and Mail::IMAPClient 3.42
Transfer started at Friday 26 May 2023-05-26 16:40:47 +0600 +06
PID is 58016 my PPID is 1973
Log file is LOG_imapsync/2023_05_26_16_40_47_711_exampleuser@exchange.kz_exampleuser@zimbra.kz.txt ( to change it, use --logfile path ; or use --nolog to turn off logging )
Load is 0.73 0.46 0.39 1/640 on 10 cores
Current directory is /root
Real user id is root (uid 0)
Effective user id is root (euid 0)
$RCSfile: imapsync,v $ $Revision: 2.229 $ $Date: 2022/09/14 18:08:24 $
Command line used, run by /usr/bin/perl:
/usr/bin/imapsync --host1 my.exchange.server --user1 exampleuser@exchange.kz --authuser1 exampleuser@exchange.kz --password1 MASKED --authmech1 Gssapi --host2 my.zimbra.server --user2 exampleuser@zimbra.kz --authuser2 admin@my.zimbra.server --password2 MASKED --authmech2 PLAIN
Temp directory is /tmp ( to change it use --tmpdir dirpath )
kill -QUIT 58016 # special behavior: call to sub catch_exit
kill -TERM 58016 # special behavior: call to sub catch_exit
kill -INT 58016 # special behavior: call to sub catch_reconnect
kill -HUP 58016 # special behavior: call to sub catch_print
kill -USR1 58016 # special behavior: call to sub toggle_sleep
Removing old /tmp/imapsync.pid since its PID 52697 is not running anymore (oo-killed?)
Removed old /tmp/imapsync.pid
PID file is /tmp/imapsync.pid ( to change it, use --pidfile filepath ; to avoid it use --pidfile "" )
Writing my PID 58016 in /tmp/imapsync.pid
Writing also my logfile name in /tmp/imapsync.pid : LOG_imapsync/2023_05_26_16_40_47_711_exampleuser@exchange.kz_exampleuser@zimbra.kz.txt
Modules version list ( use --no-modulesversion to turn off printing this Perl modules list ):
Authen::NTLM 1.09
CGI Not installed
Compress::Zlib 2.081
Crypt::OpenSSL::RSA 0.31
Data::Uniqid 0.12
Digest::HMAC_MD5 1.01
Digest::HMAC_SHA1 1.03
Digest::MD5 2.55
Encode 2.97
Encode::IMAPUTF7 1.05
File::Copy::Recursive 0.40
File::Spec 3.74
Getopt::Long 2.5
HTML::Entities Not installed
IO::Socket 1.38
IO::Socket::INET 1.35
IO::Socket::INET6 2.72
IO::Socket::IP 0.39
IO::Socket::SSL 2.066
IO::Tee 0.65
JSON 2.97001
JSON::WebToken 0.10
LWP Not installed
MIME::Base64 3.15
Mail::IMAPClient 3.42
Net::Ping 2.55
Net::SSLeay 1.88
Term::ReadKey 2.37
Test::MockObject 1.20180705
Time::HiRes 1.9758
URI::Escape 3.31
Unicode::String 2.10

Info: will resync flags for already transferred messages. Use --noresyncflags to not resync flags.
Host1: probing ssl on port 993 ( use --nosslcheck to avoid this ssl probe )
Host1: sslcheck detected open ssl port 993 so turning ssl on (use --nossl1 --notls1 to turn off SSL and TLS wizardry)
Host2: probing ssl on port 993 ( use --nosslcheck to avoid this ssl probe )
Host2: sslcheck detected open ssl port 993 so turning ssl on (use --nossl2 --notls2 to turn off SSL and TLS wizardry)
SSL debug mode level is --debugssl 1 (can be set from 0 meaning no debug to 4 meaning max debug)
Host1: SSL default mode is like --sslargs1 "SSL_verify_mode=0", meaning for host1 SSL_VERIFY_NONE, ie, do not check the server certificate.
Host1: Use --sslargs1 SSL_verify_mode=1 to have SSL_VERIFY_PEER, ie, check the server certificate. of host1
Host2: SSL default mode is like --sslargs2 "SSL_verify_mode=0", meaning for host2 SSL_VERIFY_NONE, ie, do not check the server certificate.
Host2: Use --sslargs2 SSL_verify_mode=1 to have SSL_VERIFY_PEER, ie, check the server certificate. of host2
Info: turned ON syncinternaldates, will set the internal dates (arrival dates) on host2 same as host1.
Host1: will try to use GSSAPI authentication on host1
Host2: will try to use PLAIN authentication on host2
Host1: imap connection timeout is 120 seconds
Host2: imap connection timeout is 120 seconds
Host1: imap connection keepalive is on on host1. Use --nokeepalive1 to disable it.
Host2: imap connection keepalive is on on host2. Use --nokeepalive2 to disable it.
Host1: IMAP server [my.exchange.server] port [993] user [exampleuser@exchange.kz]
Host2: IMAP server [my.zimbra.server ] port [993] user [exampleuser@zimbra.kz]
Host1: connecting and login on host1 [my.exchange.server] port [993] with user [exampleuser@exchange.kz]
Host1 IP address: *my.exchange.ip Local IP address: my.zimbra.ip
Host1 banner: * OK The Microsoft Exchange IMAP4 service is ready.
Host1 capability before authentication: IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=NTLM AUTH=GSSAPI SASL-IR UIDPLUS MOVE ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+ AUTH
Host1: my.exchange.server says it has CAPABILITY for AUTHENTICATE GSSAPI
Can't use an undefined value as a subroutine reference at /usr/share/perl5/vendor_perl/Mail/IMAPClient.pm line 3279.

I think in this report 3 last message most important and i ask you to pay attention to these lines:
Host1 capability before authentication: IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=NTLM AUTH=GSSAPI SASL-IR UIDPLUS MOVE ID UNSELECT CHILDREN IDLE NAMESPACE LITERAL+ AUTH
Host1: my.exchange.server says it has CAPABILITY for AUTHENTICATE GSSAPI
Can't use an undefined value as a subroutine reference at /usr/share/perl5/vendor_perl/Mail/IMAPClient.pm line 3279.


I will be very grateful if you help me to resolve this problem. Thanks!
karl.b
Zimbra Employee
Zimbra Employee
Posts: 37
Joined: Tue Aug 02, 2022 3:31 pm

Re: imapsync: error when migrate from Exchange

Post by karl.b »

This line "Can't use an undefined value as a subroutine reference at /usr/share/perl5/vendor_perl/Mail/IMAPClient.pm line 3279." is clearly a bug/issue in the Imapsync code itself. Synacor does not maintain that code unfortunately, this is maintained by Gilles Lamiral. Many of our customers use it however. Is there another authentication method you can use with Exchange? The issue occurs directly after this line "Host1: my.exchange.server says it has CAPABILITY for AUTHENTICATE GSSAPI", so it makes me wonder if you could get AUTH PLAIN to work, even temporarily - see if it gets past that error. You should also review this - https://imapsync.lamiral.info/FAQ.d/FAQ.Exchange.txt, and this https://github.com/imapsync/imapsync/issues/. In some of those it appears others can get auth plain to work. Wish we could be more help, but the Zimbra auth appears to be fine, this is and Exchange + ImapSync issue.
elijah_y_o
Posts: 2
Joined: Fri May 26, 2023 11:33 am

Re: imapsync: error when migrate from Exchange

Post by elijah_y_o »

Thanks, we resolve problem with authentication, first of all we use script with these options:

imapsync --host1 exhange.server.com --user1 user@exchange.com --authuser1 adminuser@exchange.com --password1 "********" --authmech1 PLAIN --nosslcheck --host2 zimbra.server.com --user2 "user@zimbra.com" --authuser2 "adminuser@zimbra.com" --password2 '*******' --authmech2 PLAIN

And second thing, that really reason of the problem was our admin-exchange account, that hadn’t full access to our users. We used next command in powershell to resolve this problem:

Get-Mailbox -ResultSize unlimited -Filter {(RecipientTypeDetails -eq 'UserMailbox') -and (Alias -ne 'Admin')} | Add-MailboxPermission -User admin_accout@exchange.com -AccessRights fullaccess -InheritanceType all -AutoMapping:$false

It really helpful, it works now, but we have another problem – long time migration. We try migrate our one account with mailbox that size near 5 GB and 175.000 messages for all folders. It started almost one day ago and still migrating. Parsing headers is really crazy, and we don’t know how resolve this proplem.
Image
Post Reply