=== modified file 'twisted/mail/smtp.py'
|
|
|
|
| 8 | 8 | |
| 9 | 9 | import time, re, base64, types, socket, os, random, rfc822 |
| 10 | 10 | import binascii |
| | 11 | import warnings |
| 11 | 12 | from email.base64MIME import encode as encode_base64 |
| 12 | 13 | |
| 13 | 14 | from zope.interface import implements, Interface |
| … |
… |
|
| 984 | 985 | class SMTPClient(basic.LineReceiver, policies.TimeoutMixin): |
| 985 | 986 | """ |
| 986 | 987 | SMTP client for sending emails. |
| 987 | | |
| | 988 | |
| 988 | 989 | After the client has connected to the SMTP server, it repeatedly calls |
| 989 | 990 | L{SMTPClient.getMailFrom}, L{SMTPClient.getMailTo} and |
| 990 | 991 | L{SMTPClient.getMailData} and uses this information to send an email. |
| … |
… |
|
| 1246 | 1247 | self.context = contextFactory |
| 1247 | 1248 | |
| 1248 | 1249 | |
| | 1250 | def __setattr__(self, name, value): |
| | 1251 | if name == "tlsMode": |
| | 1252 | warnings.warn( |
| | 1253 | "tlsMode attribute of twisted.mail.smtp.ESMTPClient " |
| | 1254 | "is deprecated since Twisted 13.0", |
| | 1255 | category=DeprecationWarning, stacklevel=2) |
| | 1256 | self.__dict__[name] = value |
| | 1257 | |
| | 1258 | |
| 1249 | 1259 | def esmtpEHLORequired(self, code=-1, resp=None): |
| 1250 | 1260 | self.sendError(EHLORequiredError(502, "Server does not support ESMTP Authentication", self.log.str())) |
| 1251 | 1261 | |
| … |
… |
|
| 1684 | 1694 | |
| 1685 | 1695 | class SMTPSender(SenderMixin, SMTPClient): |
| 1686 | 1696 | """ |
| 1687 | | SMTP protocol that sends a single email based on information it |
| | 1697 | SMTP protocol that sends a single email based on information it |
| 1688 | 1698 | gets from its factory, a L{SMTPSenderFactory}. |
| 1689 | 1699 | """ |
| 1690 | 1700 | |
=== modified file 'twisted/mail/test/test_smtp.py'
|
|
|
|
| 1611 | 1611 | |
| 1612 | 1612 | # The client give up |
| 1613 | 1613 | self.assertEqual("QUIT\r\n", transport.value()) |
| | 1614 | |
| | 1615 | |
| | 1616 | def test_esmtpClientTlsModeDeprecation(self): |
| | 1617 | """ |
| | 1618 | L{smtp.ESMTPClient.tlsMode} is deprecated. |
| | 1619 | """ |
| | 1620 | self.clientProtocol.tlsMode = False |
| | 1621 | warningsShown = self.flushWarnings( |
| | 1622 | offendingFunctions=[self.test_esmtpClientTlsModeDeprecation]) |
| | 1623 | self.assertEqual(len(warningsShown), 1) |
| | 1624 | self.assertIdentical( |
| | 1625 | warningsShown[0]['category'], DeprecationWarning) |
| | 1626 | self.assertEqual( |
| | 1627 | warningsShown[0]['message'], |
| | 1628 | "tlsMode attribute of twisted.mail.smtp.ESMTPClient " |
| | 1629 | "is deprecated since Twisted 13.0") |
=== added file 'twisted/mail/topfiles/5852.removal'
|
|
|
|
| | 1 | tlsMode attribute of twisted.mail.smtp.ESMTPClient is deprecated. |