offlineimap broken by libssl1.0.0 upgrade from 1.0.0g-1ubuntu1 to 1.0.1-2ubuntu2

Bug #969376 reported by Scott Moser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
offlineimap (Ubuntu)
Invalid
Undecided
Unassigned
openssl (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

After a recent upgrade, my offlineimap configuration broke, no longer able to imap ssl.

I can verify regression occurred in the upgrade of libssl1.0.0 from
1.0.0g-1ubuntu1 to 1.0.1-2ubuntu2 .

I'm able to fix the situation by
$ i386_url=https://launchpad.net/ubuntu/+archive/primary/+files/libssl1.0.0_1.0.0g-1ubuntu1_i386.deb
$ amd64_url=https://launchpad.net/ubuntu/+archive/primary/+files/libssl1.0.0_1.0.0g-1ubuntu1_amd64.deb
$ wget $i386_url; wget $amd64_url
$ sudo dpkg -i libssl1.0.0*.deb

Below is the trace from python after one bug in offlineimap was fixed locally (missing 'import errno').

Offlineimap does have its own "WrappedIMAP4_SLL" class that:
    """Provides an improved version of the standard IMAP4_SSL

    It provides a better readline() implementation as impaplib's
    readline() is extremly inefficient. It can also connect to IPv6
    addresses."""

So, it is possible could result from this and not be relevant elsewhere.

$ offlineimap -c offlineimaprc -u basic -a myaccout
OfflineIMAP 6.3.4
Copyright 2002-2011 John Goerzen & contributors.
Licensed under the GNU GPL v2+ (v2 or any later version).

***** Processing account myaccount
Copying folder structure from IMAP to Maildir
Establishing connection to mail.example.com:993.
WARNING: Error occured attempting to sync account 'myaccout':
Traceback (most recent call last):
  File "/usr/lib/pymodules/python2.7/offlineimap/accounts.py", line 177, in syncrunner
    self.sync()
  File "/usr/lib/pymodules/python2.7/offlineimap/accounts.py", line 235, in sync
    remoterepos.syncfoldersto(localrepos, [statusrepos])
  File "/usr/lib/pymodules/python2.7/offlineimap/repository/Base.py", line 124, in syncfoldersto
    srcfolders = src.getfolders()
  File "/usr/lib/pymodules/python2.7/offlineimap/repository/IMAP.py", line 276, in getfolders
    imapobj = self.imapserver.acquireconnection()
  File "/usr/lib/pymodules/python2.7/offlineimap/imapserver.py", line 211, in acquireconnection
    cacertfile = self.sslcacertfile)
  File "/usr/lib/pymodules/python2.7/offlineimap/imaplibutil.py", line 141, in __init__
    IMAP4_SSL.__init__(self, *args, **kwargs)
  File "/usr/lib/pymodules/python2.7/offlineimap/imaplib2.py", line 1955, in __init__
    IMAP4.__init__(self, host, port, debug, debug_file, identifier, timeout, debug_buf_lvl)
  File "/usr/lib/pymodules/python2.7/offlineimap/imaplib2.py", line 322, in __init__
    self.open(host, port)
  File "/usr/lib/pymodules/python2.7/offlineimap/imaplibutil.py", line 186, in open
    cert_reqs = requirecert)
  File "/usr/lib/python2.7/ssl.py", line 381, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 143, in __init__
    self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 305, in do_handshake
    self._sslobj.do_handshake()
error: [Errno 104] Connection reset by peer

ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: libssl1.0.0 1.0.1-2ubuntu2
ProcVersionSignature: Ubuntu 3.2.0-18.28-generic 3.2.9
Uname: Linux 3.2.0-18-generic x86_64
ApportVersion: 1.95-0ubuntu1
Architecture: amd64
Date: Fri Mar 30 12:33:46 2012
EcryptfsInUse: Yes
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Release amd64 (20111012)
ProcEnviron:
 TERM=xterm
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: openssl
UpgradeStatus: Upgraded to precise on 2011-11-07 (144 days ago)

Revision history for this message
Scott Moser (smoser) wrote :
tags: added: regression-release
Revision history for this message
Scott Moser (smoser) wrote :

Verified that this is present in the latest offlineimap release (6.3.4-1).

ERROR: Exceptions occurred during the run!
ERROR: While attempting to sync account 'ssm'
  [Errno 104] Connection reset by peer

Traceback:
  File "/usr/lib/pymodules/python2.7/offlineimap/accounts.py", line 231, in syncrunner
    self.sync()
  File "/usr/lib/pymodules/python2.7/offlineimap/accounts.py", line 287, in sync
    remoterepos.getfolders()
  File "/usr/lib/pymodules/python2.7/offlineimap/repository/IMAP.py", line 266, in getfolders
    imapobj = self.imapserver.acquireconnection()
  File "/usr/lib/pymodules/python2.7/offlineimap/imapserver.py", line 219, in acquireconnection
    fingerprint=fingerprint
  File "/usr/lib/pymodules/python2.7/offlineimap/imaplibutil.py", line 146, in __init__
    super(WrappedIMAP4_SSL, self).__init__(*args, **kwargs)
  File "/usr/lib/pymodules/python2.7/offlineimap/imaplib2.py", line 1997, in __init__
    IMAP4.__init__(self, host, port, debug, debug_file, identifier, timeout, debug_buf_lvl)
  File "/usr/lib/pymodules/python2.7/offlineimap/imaplib2.py", line 329, in __init__
    self.open(host, port)
  File "/usr/lib/pymodules/python2.7/offlineimap/imaplibutil.py", line 149, in open
    super(WrappedIMAP4_SSL, self).open(host, port)
  File "/usr/lib/pymodules/python2.7/offlineimap/imaplib2.py", line 2010, in open
    self.ssl_wrap_socket()
  File "/usr/lib/pymodules/python2.7/offlineimap/imaplib2.py", line 463, in ssl_wrap_socket
    self.sock = ssl.wrap_socket(self.sock, self.keyfile, self.certfile, ca_certs=self.ca_certs, cert_reqs=cert_reqs)
  File "/usr/lib/python2.7/ssl.py", line 381, in wrap_socket
    ciphers=ciphers)
  File "/usr/lib/python2.7/ssl.py", line 143, in __init__
    self.do_handshake()
  File "/usr/lib/python2.7/ssl.py", line 305, in do_handshake
    self._sslobj.do_handshake()

Revision history for this message
Scott Moser (smoser) wrote :

Verified that this is *not* fixed by upgrading to latest imaplib2

http://imaplib2.git.sourceforge.net/git/gitweb.cgi?p=imaplib2/imaplib2;a=summary

From 3af048b2c459c6952a061edcc8b205f00515a579 Mon Sep 17 00:00:00 2001
From: Piers Lauder <email address hidden>
Date: Sun, 22 Jan 2012 16:28:35 +1100
Subject: [PATCH] Fix _choose_nonull_or_dflt() for correct arg to first isinstance

Revision history for this message
Scott Moser (smoser) wrote :
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Can you try openssl (1.0.1-2ubuntu3) that just got uploaded?

Revision history for this message
Scott Moser (smoser) wrote :

This was fixed in 1.0.1-2ubuntu3

Changed in offlineimap (Ubuntu):
status: New → Invalid
Changed in openssl (Ubuntu):
importance: Undecided → Medium
status: New → Fix Released
Revision history for this message
Scott Moser (smoser) wrote :

Just for reference, this bug ended up being fixed by the changes for bug 965371.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.