summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2008-01-17 08:35:49 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2008-01-17 08:35:49 (GMT)
commitbde4ae4bdeb3328fbc744662ecdebfac52b2d5ba (patch)
tree28ac88b9fbaa834fe5e77389edc1f972ce61b178 /Doc
parentd59f4572798e473d3ed781a7ef615b0967f5e4c3 (diff)
downloadcpython-bde4ae4bdeb3328fbc744662ecdebfac52b2d5ba.zip
cpython-bde4ae4bdeb3328fbc744662ecdebfac52b2d5ba.tar.gz
cpython-bde4ae4bdeb3328fbc744662ecdebfac52b2d5ba.tar.bz2
Fixes (accepts patch) issue1339 - http://bugs.python.org/issue1339
- Factor out the duplication of EHLO/HELO in login() and sendmail() to a new function, ehlo_or_helo_if_needed(). - Use ehlo_or_helo_if_needed() in starttls() - Check for the starttls exception in starttls() in the same way as login() checks for the auth extension. Contributed by Bill Fenner.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/smtplib.rst26
1 files changed, 26 insertions, 0 deletions
diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst
index 162e77b..0aea80a 100644
--- a/Doc/library/smtplib.rst
+++ b/Doc/library/smtplib.rst
@@ -191,6 +191,16 @@ An :class:`SMTP` instance has the following methods:
necessary to call this method explicitly. It will be implicitly called by
:meth:`sendmail` when necessary.
+.. method:: SMTP.ehlo_or_helo_if_needed()
+
+ This method call :meth:`ehlo` and or :meth:`helo` if there has been no
+ previous ``EHLO`` or ``HELO`` command this session. It tries ESMTP ``EHLO``
+ first.
+
+ :exc:SMTPHeloError
+ The server didn't reply properly to the ``HELO`` greeting.
+
+ .. versionadded:: 2.6
.. method:: SMTP.has_extn(name)
@@ -237,6 +247,22 @@ An :class:`SMTP` instance has the following methods:
If *keyfile* and *certfile* are provided, these are passed to the :mod:`socket`
module's :func:`ssl` function.
+ If there has been no previous ``EHLO`` or ``HELO`` command this session,
+ this method tries ESMTP ``EHLO`` first.
+
+ .. versionchanged:: 2.6
+
+ :exc:`SMTPHeloError`
+ The server didn't reply properly to the ``HELO`` greeting.
+
+ :exc:`SMTPException`
+ The server does not support the STARTTLS extension.
+
+ .. versionchanged:: 2.6
+
+ :exc:`RuntimeError`
+ SSL/TLS support is not available to your python interpreter.
+
.. method:: SMTP.sendmail(from_addr, to_addrs, msg[, mail_options, rcpt_options])