0

Operating system Ubuntu Linux 18.04.2

I am facing a strange issue with IMAPSYNC when syncing emails from a remote host to the localhost.

First of all, telnet is not allowed by the firewall, but I can confirm that dovecot is listening on port 993.

netstat -nap | grep 993
tcp        0      0 0.0.0.0:993             0.0.0.0:*               LISTEN      873/dovecot
tcp6       0      0 :::993                  :::*                    LISTEN      873/dovecot

I can further confirm that I have mail auto-config and MS Outlook can connect remotely to the server and sync emails. I can also confirm that issuing this command begins synchronization and successfully executes:

imapsync --dry --ssl1 --ssl2 --host1 remoteserver.com --user1 user@remoteserver.com --password1 'MASKED' --host2 localhost --user2 user@localserver.com --password2 'MASKED'

Debug level 4 output of above successful command:

Host2: connecting and login on host2 [localhost] port [993] with user [user@localserver.com]
DEBUG: .../IO/Socket/SSL.pm:2853: new ctx 93973258583824
DEBUG: .../IO/Socket/SSL.pm:692: socket not yet connected
DEBUG: .../IO/Socket/SSL.pm:694: socket connected
DEBUG: .../IO/Socket/SSL.pm:717: ssl handshake not started
DEBUG: .../IO/Socket/SSL.pm:750: using SNI with hostname localhost
DEBUG: .../IO/Socket/SSL.pm:806: set socket to non-blocking to enforce timeout=120
DEBUG: .../IO/Socket/SSL.pm:819: call Net::SSLeay::connect
DEBUG: .../IO/Socket/SSL.pm:822: done Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:832: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:842: waiting for fd to become ready: SSL wants a read first
DEBUG: .../IO/Socket/SSL.pm:862: socket ready, retrying connect
DEBUG: .../IO/Socket/SSL.pm:819: call Net::SSLeay::connect
DEBUG: .../IO/Socket/SSL.pm:822: done Net::SSLeay::connect -> -1
DEBUG: .../IO/Socket/SSL.pm:832: ssl handshake in progress
DEBUG: .../IO/Socket/SSL.pm:842: waiting for fd to become ready: SSL wants a read first
DEBUG: .../IO/Socket/SSL.pm:862: socket ready, retrying connect
DEBUG: .../IO/Socket/SSL.pm:819: call Net::SSLeay::connect
DEBUG: .../IO/Socket/SSL.pm:822: done Net::SSLeay::connect -> 1
DEBUG: .../IO/Socket/SSL.pm:877: ssl handshake done
Host2 IP address: 127.0.0.1
Host2 banner: * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN] Dovecot (Ubuntu) ready.
Host2 capability before authentication: IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE AUTH=PLAIN AUTH=LOGIN AUTH
Host2: localhost says it has CAPABILITY for AUTHENTICATE LOGIN
Host2: success login on [localhost] with user [user@localserver.com] auth [LOGIN]

PROBLEM: When I use the public IP address of the local server, or the name. These fail:

imapsync --dry --ssl1 --ssl2 --host1 remoteserver.com --user1 user@remoteserver.com --password1 'MASKED' --host2 xxx.xxx.xxx.xxx --user2 user@localserver.com --password2 'MASKED'

imapsync --dry --ssl1 --ssl2 --host1 remoteserver.com --user1 user@remoteserver.com --password1 'MASKED' --host2 mail.localserver.com --user2 user@localserver.com --password2 'MASKED'

Debug level 4 error:

Host2: connecting and login on host2 [mail.localserver.com] port [993] with user [user@localserver.com]
DEBUG: .../IO/Socket/SSL.pm:2853: new ctx 93834940862224
DEBUG: .../IO/Socket/SSL.pm:692: socket not yet connected
DEBUG: ...5.26/IO/Socket.pm:48: local error: IO::Socket::IP configuration failed
DEBUG: .../IO/Socket/SSL.pm:2875: free ctx 93834940862224 open=93834970518272 93834940862224
DEBUG: .../IO/Socket/SSL.pm:2886: OK free ctx 93834940862224
Host2 failure: can not open imap connection on host2 [mail.localserver.com] with user [user@localserver.com]: Unable to connect to mail.localserver.com: IO::Socket::IP configuration failed Connection refused
Exiting with return value 10 (EXIT_CONNECTION_FAILURE)

Any ideas?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.