Table of Contents
SSL routines::unexpected eof while reading
imapsync \
--host1 mail.duybao.me \
--user1 [email protected] \
--password1 $password1 \
\
--host2 mail.duykhang.me \
--user2 [email protected] \
--password2 $password2 \
--justlogin
In some cases, you got this error when trying to migrate emails from Exchange Server using imapsync.
Host1 capability before authentication: IMAP4 IMAP4rev1 LOGINDISABLED STARTTLS UIDPLUS MOVE ID CHILDREN IDLE NAMESPACE LITERAL+
Host1: going to ssl because STARTTLS is in CAPABILITY. Use --notls1 or --notls2 to avoid that behavior
DEBUG: .../IO/Socket/SSL.pm:842: local error: SSL connect attempt failed error:0A000126:SSL routines::unexpected eof while reading
DEBUG: .../IO/Socket/SSL.pm:845: fatal SSL error: SSL connect attempt failed error:0A000126:SSL routines::unexpected eof while reading
Host1 failure: Can not go to tls encryption on host1 [mail.duybao.me]: Unable to start TLS: SSL connect attempt failed error:0A000126:SSL routines::unexpected eof while reading
You got it because the Exchange server doesn’t have a valid certificate or using a self-certificate.
To fix it, you need to change the authentication for IMAP protocol to Basic Authentication on your Exchange Server. The steps are shown in the below screenshot.
Changing the login method requires restart the IMAP services. You can restart them from services.msc or can do it using PowerShell:
Get-Service *imap* | Restart-Service
Because the Exchange server doesn’t have a valid certificate, so you need to add these options in the migration command.
imapsync \
--host1 mail.duybao.me \
--user1 [email protected] \
--password1 $password1 \
--nosslcheck \
--notls1 \
\
--host2 mail.duykhang.me \
--user2 [email protected] \
--password2 $password2 \
--justlogin
The error should be gone then imapsync can be authenticated for migration.
Host1: IMAP server [mail.duybao.me] port [143] user [[email protected]]
Host2: IMAP server [mail.duykhang.me] port [143] user [[email protected]]
Host1: connecting and login on host1 [mail.duybao.me] port [143] with user [[email protected]]
Host1 IP address: 20.232.97.85 Local IP address: 10.0.0.4
Host1 banner: * OK The Microsoft Exchange IMAP4 service is ready.
Host1 capability before authentication: IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=NTLM AUTH=GSSAPI STARTTLS
Host1: success login on [mail.duybao.me] with user [[email protected]] auth [LOGIN] or [LOGIN]
Host2: connecting and login on host2 [mail.duykhang.me] port [143] with user [[email protected]]
Host2 IP address: 20.127.32.166 Local IP address: 10.0.0.4
Host2 banner: * OK IMAPrev1
Host2 capability before authentication: IMAP4 IMAP4rev1 CHILDREN IDLE QUOTA SORT ACL
Host2: success login on [mail.duykhang.me] with user [[email protected]] auth [LOGIN] or [LOGIN]
Host1: state Authenticated
Host2: state Authenticated
Not a reader? Watch this related video tutorial:
5/5 - (1 vote)