summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorR David Murray <rdmurray@bitdance.com>2015-05-16 17:58:14 (GMT)
committerR David Murray <rdmurray@bitdance.com>2015-05-16 17:58:14 (GMT)
commitcee7cf60263210ca34f8221fc7dabd360c825533 (patch)
tree0c92234dbae918c8fa655681fdf41f0e3befc23e /Doc/library
parentb907a513c8285410d93adc2895508985838fe1a7 (diff)
downloadcpython-cee7cf60263210ca34f8221fc7dabd360c825533.zip
cpython-cee7cf60263210ca34f8221fc7dabd360c825533.tar.gz
cpython-cee7cf60263210ca34f8221fc7dabd360c825533.tar.bz2
#22027: Add RFC6531 support to smtplib.
Initial patch by Milan Oberkirch.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/smtplib.rst35
1 files changed, 34 insertions, 1 deletions
diff --git a/Doc/library/smtplib.rst b/Doc/library/smtplib.rst
index 44473fe..133fa56 100644
--- a/Doc/library/smtplib.rst
+++ b/Doc/library/smtplib.rst
@@ -61,6 +61,10 @@ Protocol) and :rfc:`1869` (SMTP Service Extensions).
.. versionchanged:: 3.3
source_address argument was added.
+ .. versionadded:: 3.5
+ The SMTPUTF8 extension (:rfc:`6531`) is now supported.
+
+
.. class:: SMTP_SSL(host='', port=0, local_hostname=None, keyfile=None, \
certfile=None [, timeout], context=None, \
source_address=None)
@@ -161,6 +165,13 @@ A nice selection of exceptions is defined as well:
The server refused our ``HELO`` message.
+.. exception:: SMTPNotSupportedError
+
+ The command or option attempted is not supported by the server.
+
+ .. versionadded:: 3.5
+
+
.. exception:: SMTPAuthenticationError
SMTP authentication went wrong. Most probably the server didn't accept the
@@ -291,6 +302,9 @@ An :class:`SMTP` instance has the following methods:
:exc:`SMTPAuthenticationError`
The server didn't accept the username/password combination.
+ :exc:`SMTPNotSupportedError`
+ The ``AUTH`` command is not supported by the server.
+
:exc:`SMTPException`
No suitable authentication method was found.
@@ -298,6 +312,9 @@ An :class:`SMTP` instance has the following methods:
turn if they are advertised as supported by the server (see :meth:`auth`
for a list of supported authentication methods).
+ .. versionchanged:: 3.5
+ :exc:`SMTPNotSupportedError` may be raised.
+
.. method:: SMTP.auth(mechanism, authobject)
@@ -349,7 +366,7 @@ An :class:`SMTP` instance has the following methods:
:exc:`SMTPHeloError`
The server didn't reply properly to the ``HELO`` greeting.
- :exc:`SMTPException`
+ :exc:`SMTPNotSupportedError`
The server does not support the STARTTLS extension.
:exc:`RuntimeError`
@@ -363,6 +380,11 @@ An :class:`SMTP` instance has the following methods:
:attr:`SSLContext.check_hostname` and *Server Name Indicator* (see
:data:`~ssl.HAS_SNI`).
+ .. versionchanged:: 3.5
+ The error raised for lack of STARTTLS support is now the
+ :exc:`SMTPNotSupportedError` subclass instead of the base
+ :exc:`SMTPException`.
+
.. method:: SMTP.sendmail(from_addr, to_addrs, msg, mail_options=[], rcpt_options=[])
@@ -399,6 +421,9 @@ An :class:`SMTP` instance has the following methods:
recipient that was refused. Each entry contains a tuple of the SMTP error code
and the accompanying error message sent by the server.
+ If ``SMTPUTF8`` is included in *mail_options*, and the server supports it,
+ *from_addr* and *to_addr* may contain non-ASCII characters.
+
This method may raise the following exceptions:
:exc:`SMTPRecipientsRefused`
@@ -417,12 +442,20 @@ An :class:`SMTP` instance has the following methods:
The server replied with an unexpected error code (other than a refusal of a
recipient).
+ :exc:`SMTPNotSupportedError`
+ ``SMTPUTF8`` was given in the *mail_options* but is not supported by the
+ server.
+
Unless otherwise noted, the connection will be open even after an exception is
raised.
.. versionchanged:: 3.2
*msg* may be a byte string.
+ .. versionchanged:: 3.5
+ ``SMTPUTF8`` support added, and :exc:`SMTPNotSupportedError` may be
+ raised if ``SMTPUTF8`` is specified but the server does not support it.
+
.. method:: SMTP.send_message(msg, from_addr=None, to_addrs=None, \
mail_options=[], rcpt_options=[])