Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Errno 54] Connection reset by peer #606

Closed
mm3509 opened this issue Mar 22, 2019 · 5 comments
Closed

[Errno 54] Connection reset by peer #606

mm3509 opened this issue Mar 22, 2019 · 5 comments

Comments

@mm3509
Copy link

mm3509 commented Mar 22, 2019

General informations

  • system/distribution (with version): macOS 10.14.3
  • offlineimap version (offlineimap -V): offlineimap v7.2.3, imaplib2 v2.57 (bundled), Python v2.7.16, OpenSSL 1.0.2r 26 Feb 2019
  • Python version: 2.7.16
  • server name or domain: outlook.office365.com
  • CLI options: none

Configuration file offlineimaprc

[general]
accounts = Exchange
maxsyncaccounts = 1

[Account Exchange]
localrepository = LocalExchange
remoterepository = RepositoryExchange
quick = 10
postsynchook = mu index --maildir ~/Maildir

[Repository LocalExchange]
type = Maildir
localfolders = ~/Maildir/Exchange

[Repository RepositoryExchange]
type = IMAP
maxconnections = 1
remotehost = outlook.office365.com
remoteuser = [omitted]
remotepass = [omitted]
holdconnectionopen = yes

# This line will only work for macOS
ssl=true
sslcacertfile = /usr/local/etc/openssl/cert.pem
ssl_version = tls1_2

Logs, error

OfflineIMAP 7.2.3
  Licensed under the GNU GPL v2 or any later version (with an OpenSSL exception)
imaplib2 v2.57 (bundled), Python v2.7.16, OpenSSL 1.0.2r  26 Feb 2019
Account sync Exchange:
 *** Processing account Exchange
 Establishing connection to outlook.office365.com:993 (RepositoryExchange)
 ERROR: While attempting to sync account 'Exchange'
  [Errno 54] Connection reset by peer
 *** Finished account 'Exchange' in 0:00
ERROR: Exceptions occurred during the run!
ERROR: While attempting to sync account 'Exchange'
  [Errno 54] Connection reset by peer

Traceback:
  File "/usr/local/Cellar/offlineimap/7.2.3/libexec/offlineimap/accounts.py", line 283, in syncrunner
    self.__sync()
  File "/usr/local/Cellar/offlineimap/7.2.3/libexec/offlineimap/accounts.py", line 359, in __sync
    remoterepos.getfolders()
  File "/usr/local/Cellar/offlineimap/7.2.3/libexec/offlineimap/repository/IMAP.py", line 452, in getfolders
    imapobj = self.imapserver.acquireconnection()
  File "/usr/local/Cellar/offlineimap/7.2.3/libexec/offlineimap/imapserver.py", line 572, in acquireconnection
    af=self.af,
  File "/usr/local/Cellar/offlineimap/7.2.3/libexec/offlineimap/imaplibutil.py", line 194, in __init__
    super(WrappedIMAP4_SSL, self).__init__(*args, **kwargs)
  File "/usr/local/Cellar/offlineimap/7.2.3/libexec/offlineimap/bundled_imaplib2.py", line 2183, in __init__
    IMAP4.__init__(self, host, port, debug, debug_file, identifier, timeout, debug_buf_lvl)
  File "/usr/local/Cellar/offlineimap/7.2.3/libexec/offlineimap/bundled_imaplib2.py", line 361, in __init__
    self.open(host, port)
  File "/usr/local/Cellar/offlineimap/7.2.3/libexec/offlineimap/imaplibutil.py", line 202, in open
    super(WrappedIMAP4_SSL, self).open(host, port)
  File "/usr/local/Cellar/offlineimap/7.2.3/libexec/offlineimap/bundled_imaplib2.py", line 2196, in open
    self.ssl_wrap_socket()
  File "/usr/local/Cellar/offlineimap/7.2.3/libexec/offlineimap/bundled_imaplib2.py", line 548, in ssl_wrap_socket
    self.sock = ssl.wrap_socket(self.sock, self.keyfile, self.certfile, ca_certs=self.ca_certs, cert_reqs=cert_reqs, ssl_version=ssl_version)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 931, in wrap_socket
    ciphers=ciphers)
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 599, in __init__
    self.do_handshake()
  File "/usr/local/Cellar/python@2/2.7.16/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ssl.py", line 828, in do_handshake
    self._sslobj.do_handshake()

Steps to reproduce the error

This problem started yesterday with Offlineimap 7.2.1. I had run offlineimap earlier in the day and it worked. I did not change anything in the configuration in between the two runs. Email sync still works on another email client, so I don't think it's a problem with the server. I upgraded to the latest version and added maxconnections = 1 as in this issue and ssl_version = tls1_2 as in this issue. I still have the same problem.

@mm3509 mm3509 changed the title [Errno 54] Connection reset by peer [Errno 54] Connection reset by peer Mar 22, 2019
@nicolas33
Copy link
Member

Does it work in starttls mode?
Could you try your previous version again on the same system, please?

@mm3509
Copy link
Author

mm3509 commented Mar 22, 2019

I got this error with both 7.2.1 and 7.2.3. I just tried it again and it works now, either with starttls = yes or starttls = no. Maybe it was an issue with the server? Does offlineimap save logs that I could inspect?

@nicolas33
Copy link
Member

No, offlineimap doesn't keep the log if not requested.

@mm3509
Copy link
Author

mm3509 commented May 30, 2019

I've had the same problem for 3 days now. One minimal change is the network: I get this error on my corporate network and not in the guest network. Mail.app works fine on both networks. I'm happy to provide any logs or try fixes.

@nicolas33
Copy link
Member

There is likely an issue related with the corporate network:

  • port filtered/closed
  • certificate change/usurpation
  • a proxy doing weird things
  • etc

I think you should request the admin of the corporate network.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants