commit | 2e1b7fc998e1744eeb3bb31b131eba0145b88a2f | [log] [tgz] |
---|---|---|
author | Benjamin Peterson <benjamin@python.org> | Sat Jun 11 13:16:42 2016 -0700 |
committer | Benjamin Peterson <benjamin@python.org> | Sat Jun 11 13:16:42 2016 -0700 |
tree | 1c6fb1125b31b8596ac3c53625afa2f3601edd5e | |
parent | 391f1a425241794668b8ca5cb004e7457d0f2a7e [diff] [blame] |
raise an error when STARTTLS fails
diff --git a/Lib/smtplib.py b/Lib/smtplib.py index 8388b98..e1651c0 100755 --- a/Lib/smtplib.py +++ b/Lib/smtplib.py
@@ -656,6 +656,11 @@ self.ehlo_resp = None self.esmtp_features = {} self.does_esmtp = 0 + else: + # RFC 3207: + # 501 Syntax error (no parameters allowed) + # 454 TLS not available due to temporary reason + raise SMTPResponseException(resp, reply) return (resp, reply) def sendmail(self, from_addr, to_addrs, msg, mail_options=[],