[Patches] [ python-Patches-524327 ] imaplib.py and SSL
noreply@sourceforge.net
noreply@sourceforge.net
Mon, 04 Mar 2002 02:55:18 -0800
Patches item #524327, was opened at 2002-03-01 14:46
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=524327&group_id=5470
Category: Library (Lib)
Group: Python 2.2.x
Status: Open
Resolution: None
Priority: 5
Submitted By: Tino Lange (tinolange)
Assigned to: Piers Lauder (pierslauder)
Summary: imaplib.py and SSL
Initial Comment:
Hallo!
Our company has decided to allow only SSL connections
to the e-mailbox from outside. So I needed a SSL
capable "imaplib.py" to run my mailwatcher-scripts
from home.
Thanks to the socket.ssl() in recent Pythons it was
nearly no problem to derive an IMAP4_SSL-class from
the existing IMAP4-class in Python's standard library.
Maybe you want to look over the very small additions
that were necessary to implement the IMAP-over-SSL-
functionality and add it as a part of the next
official "imaplib.py"?
Here's the context diff from the most recent CVS
version (1.43). It works fine for me this way and it's
only a few straight-forward lines of code.
Maybe I could contribute a bit to the Python project
with this patch?
Best regards
Tino Lange
----------------------------------------------------------------------
>Comment By: Tino Lange (tinolange)
Date: 2002-03-04 11:55
Message:
Logged In: YES
user_id=212920
Hallo!
socket.ssl() -Objects only have _two_ methods
read()
write()
I don't know how they handle write() internally - whether
they use a send() or a sendall() equivalent for the
underlying socket call. I didn't look in the C sources for
that.
That's also why I had to code the readline() by hand in the
while-loop, because socket.ssl() - Objects only have read(),
no readline().
But the implementation works quite fine (by the way also
under Windows after replacing the _socket.pyd with an SSL
enabled one).
Best regards
Tino
----------------------------------------------------------------------
Comment By: Piers Lauder (pierslauder)
Date: 2002-03-04 06:47
Message:
Logged In: YES
user_id=196212
This seems fine to me, but i can't test it as i don't have
access to an ssl-enabled imapd. My only caveat is - do
socket.ssl objects have a "sendall" method? - in which case
that is what should be used in the send method.
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=524327&group_id=5470