classification
Title: IMAP4 SSL isn't working
Type: Stage:
Components: Library (Lib) Versions: Python 3.0
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: janssen Nosy List: christian.heimes, dbinger, janssen, vila
Priority: normal Keywords: patch

Created on 2007-11-21 09:27 by christian.heimes, last changed 2008-02-01 02:53 by janssen. This issue is now closed.

Files
File name Uploaded Description Edit
b janssen, 2007-12-11 03:10
Messages (9)
msg57735 - (view) Author: Christian Heimes (christian.heimes) * (Python committer) Date: 2007-11-21 09:27
The SSL version of the imap4 client isnt' working under 3.0. After I
applied the patch from http://bugs.python.org/issue1210 I tried to
connect to an IMAP server over SSL. The connection hangs.

import imaplib
conn = imaplib.IMAP4_SSL("mailbox.rwth-aachen.de", 993)

After a while I stopped the attempt with CTRL+C
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 1137, in __init__
    IMAP4.__init__(self, host, port)
  File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 184, in __init__
    self.welcome = self._get_response()
  File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 907, in
_get_response
    resp = self._get_line()
  File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 1000, in
_get_line
    line = self.readline()
  File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 1170, in readline
    char = self.sslobj.read(1)
  File "/home/heimes/dev/python/py3k/Lib/ssl.py", line 160, in read
    return self._sslobj.read(len)
KeyboardInterrupt
msg57744 - (view) Author: Bill Janssen (janssen) * (Python committer) Date: 2007-11-21 23:07
I'll take a look at it this weekend.

Bill

On Nov 21, 2007 1:27 AM, Christian Heimes <report@bugs.python.org> wrote:
>
> New submission from Christian Heimes:
>
> The SSL version of the imap4 client isnt' working under 3.0. After I
> applied the patch from http://bugs.python.org/issue1210 I tried to
> connect to an IMAP server over SSL. The connection hangs.
>
> import imaplib
> conn = imaplib.IMAP4_SSL("mailbox.rwth-aachen.de", 993)
>
> After a while I stopped the attempt with CTRL+C
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 1137, in __init__
>     IMAP4.__init__(self, host, port)
>   File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 184, in __init__
>     self.welcome = self._get_response()
>   File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 907, in
> _get_response
>     resp = self._get_line()
>   File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 1000, in
> _get_line
>     line = self.readline()
>   File "/home/heimes/dev/python/py3k/Lib/imaplib.py", line 1170, in readline
>     char = self.sslobj.read(1)
>   File "/home/heimes/dev/python/py3k/Lib/ssl.py", line 160, in read
>     return self._sslobj.read(len)
> KeyboardInterrupt
>
> ----------
> assignee: janssen
> components: Library (Lib)
> keywords: py3k
> messages: 57735
> nosy: janssen, tiran
> priority: normal
> severity: normal
> status: open
> title: IMAP4 SSL isn't working
> versions: Python 3.0
>
> __________________________________
> Tracker <report@bugs.python.org>
> <http://bugs.python.org/issue1482>
> __________________________________
>
msg58408 - (view) Author: Bill Janssen (janssen) * (Python committer) Date: 2007-12-11 03:01
I'm still getting this with the latest SSL module fixes.  I'm guessing
this is a problem with the implementation of imaplib, but I haven't
looked into it yet.
msg58409 - (view) Author: Bill Janssen (janssen) * (Python committer) Date: 2007-12-11 03:10
Here's a fix for the 3K branch.
msg61897 - (view) Author: David Binger (dbinger) Date: 2008-01-31 12:17
Bill's patch does appear to fix the ssl-related problem.

imaplib is still broken in py3k, though, due
to bytes/str issues.
msg61913 - (view) Author: Bill Janssen (janssen) * (Python committer) Date: 2008-01-31 17:42
But that's issue 1210, which is still open.  David, do you want to
submit a patch for 1210?

Meanwhile, do we still need this issue to be open?
msg61923 - (view) Author: David Binger (dbinger) Date: 2008-01-31 18:48
On Jan 31, 2008, at 12:42 PM, Bill Janssen wrote:

>
> Bill Janssen added the comment:
>
> But that's issue 1210, which is still open.  David, do you want to
> submit a patch for 1210?

I see that you are correct that 1210 is the bytes/str issue.
I regret it, but I won't be able to supply a patch.

>
> Meanwhile, do we still need this issue to be open?

Unless I'm missing something, the patch "b" that you posted
has not been checked in.  I think the issue should remain
open until that happens.
msg61942 - (view) Author: Bill Janssen (janssen) * (Python committer) Date: 2008-02-01 02:14
I guess I'll check it in.  There's no effective test case for the
imaplib module, though.  So if it's broken, we won't know.

When I try connecting to my local IMAP server, I get

>>> c = imaplib.IMAP4("127.0.0.1")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/local/python/3k/src/Lib/imaplib.py", line 190, in __init__
    raise self.error(self.welcome)
imaplib.error: b'* OK [CAPABILITY IMAP4rev1 LOGINDISABLED STARTTLS]
UpLib IMAP Server (V4r1) ready.'
>>>

I think this is bug 1210.  However, it is able to connect to an
SSL-protected server (not the one above) and get the same error message,
so I think the SSL patch works.
msg61943 - (view) Author: Bill Janssen (janssen) * (Python committer) Date: 2008-02-01 02:17
I've committed the patch.
History
Date User Action Args
2008-02-01 02:53:55janssensetmessages: - msg61945
2008-02-01 02:53:41janssensetstatus: open -> closed
resolution: fixed
messages: + msg61945
2008-02-01 02:17:03janssensetmessages: + msg61943
2008-02-01 02:14:18janssensetmessages: + msg61942
2008-01-31 18:48:06dbingersetmessages: + msg61923
2008-01-31 17:42:10janssensetmessages: + msg61913
2008-01-31 12:17:21dbingersetnosy: + dbinger
messages: + msg61897
2008-01-06 22:29:44adminsetkeywords: - py3k
versions: Python 3.0
2008-01-05 11:49:29vilasetnosy: + vila
2007-12-11 03:12:01janssensetkeywords: + patch
2007-12-11 03:10:59janssensetfiles: + b
messages: + msg58409
2007-12-11 03:01:54janssensetmessages: + msg58408
2007-11-21 23:07:34janssensetmessages: + msg57744
2007-11-21 09:27:55christian.heimescreate