Code review comment for lp:~mbp/bzr-email/335332-starttls

Revision history for this message
Martin Pool (mbp) wrote :

=== modified file 'smtp_connection.py'
--- smtp_connection.py 2008-04-29 14:02:52 +0000
+++ smtp_connection.py 2009-03-10 02:24:12 +0000
@@ -80,7 +80,16 @@
         # If this fails, it just returns an error, but it shouldn't raise an
         # exception unless something goes really wrong (in which case we want
         # to fail anyway).
- self._connection.starttls()
+ try:
+ self._connection.starttls()
+ except smtplib.SMTPException, e:
+ if e.args[0] == 'STARTTLS extension not supported by server.':
+ # python2.6 changed to raising an exception here; we can't
+ # really do anything else without it so just continue
+ # <https://bugs.edge.launchpad.net/bzr-email/+bug/335332>
+ pass
+ else:
+ raise

     def _authenticate(self):
         """If necessary authenticate yourself to the server."""

« Back to merge proposal