From 3c4ab7fb96fcb73ebaf68e4e7d1c272b6c7776bb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 1 Sep 2010 10:31:53 -0600 Subject: [PATCH] Fix bug in email sending when using an SSL connection --- src/calibre/utils/smtp.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/calibre/utils/smtp.py b/src/calibre/utils/smtp.py index 3246810010..350d762e59 100644 --- a/src/calibre/utils/smtp.py +++ b/src/calibre/utils/smtp.py @@ -81,12 +81,7 @@ def sendmail(msg, from_, to, localhost=None, verbose=0, timeout=30, for x in to: return sendmail_direct(from_, x, msg, timeout, localhost, verbose) import smtplib - class SMTP_SSL(smtplib.SMTP_SSL): # Workaround for bug in smtplib.py - def _get_socket(self, host, port, timeout): - smtplib.SMTP_SSL._get_socket(self, host, port, timeout) - return self.sock - - cls = smtplib.SMTP if encryption == 'TLS' else SMTP_SSL + cls = smtplib.SMTP if encryption == 'TLS' else smtplib.SMTP_SSL timeout = None # Non-blocking sockets sometimes don't work port = int(port) s = cls(timeout=timeout, local_hostname=localhost)