cpython: 9f1f83d23ec4 (original) (raw)
Mercurial > cpython
changeset 84294:9f1f83d23ec4 2.7
#18179: reflow paragraphs. [#18179]
R David Murray rdmurray@bitdance.com | |
---|---|
date | Sun, 23 Jun 2013 16:10:37 -0400 |
parents | c8914dbe6ead |
children | a7db9f505e88 |
files | Doc/library/smtplib.rst Lib/smtplib.py |
diffstat | 2 files changed, 40 insertions(+), 38 deletions(-)[+] [-] Doc/library/smtplib.rst 46 Lib/smtplib.py 32 |
line wrap: on
line diff
--- a/Doc/library/smtplib.rst
+++ b/Doc/library/smtplib.rst
@@ -24,15 +24,15 @@ Protocol) and :rfc:1869
(SMTP Service
A :class:SMTP
instance encapsulates an SMTP connection. It has methods
that support a full repertoire of SMTP and ESMTP operations. If the optional
- host and port parameters are given, the SMTP :meth:
connect
method is called - with those parameters during initialization. If specified, local_hostname is
- used as the FQDN of the local host in the HELO/EHLO command. Otherwise, the
- local hostname is found using :func:
socket.getfqdn
. If the - :meth:
connect
call - returns anything other than a success code, an :exc:
SMTPConnectError
is - raised. The optional timeout parameter specifies a timeout in seconds for
- blocking operations like the connection attempt (if not specified, the
- global default timeout setting will be used).
- host and port parameters are given, the SMTP :meth:
connect
method is - called with those parameters during initialization. If specified,
- local_hostname is used as the FQDN of the local host in the HELO/EHLO
- command. Otherwise, the local hostname is found using
- :func:
socket.getfqdn
. If the :meth:connect
call returns anything other - than a success code, an :exc:
SMTPConnectError
is raised. The optional - timeout parameter specifies a timeout in seconds for blocking operations
- like the connection attempt (if not specified, the global default timeout
- setting will be used).
For normal use, you should only require the initialization/connect,
:meth:
sendmail
, and :meth:~smtplib.quit
methods. @@ -49,13 +49,12 @@ Protocol) and :rfc:1869
(SMTP Service required from the beginning of the connection and using :meth:starttls
is not appropriate. If host is not specified, the local host is used. If port is omitted, the standard SMTP-over-SSL port (465) is used.
- local_hostname has the same meaning as it does for the :class:
SMTP
class. - keyfile
- and certfile are also optional, and can contain a PEM formatted private key
- and certificate chain file for the SSL connection. The optional timeout
- parameter specifies a timeout in seconds for blocking operations like the
- connection attempt (if not specified, the global default timeout setting
- will be used).
- local_hostname has the same meaning as it does for the :class:
SMTP
- class. keyfile and certfile are also optional, and can contain a PEM
- formatted private key and certificate chain file for the SSL connection. The
- optional timeout parameter specifies a timeout in seconds for blocking
- operations like the connection attempt (if not specified, the global default
- timeout setting will be used). .. versionadded:: 2.6
@@ -63,14 +62,15 @@ Protocol) and :rfc:1869
(SMTP Service
.. class:: LMTP([host[, port[, local_hostname]]])
The LMTP protocol, which is very similar to ESMTP, is heavily based on the
- standard SMTP client. It's common to use Unix sockets for LMTP, so our :meth:
connect
- method must support that as well as a regular host:port server. local_hostname
- has the same meaning as it does for the :class:
SMTP
class. To specify a - Unix socket, you must use an absolute path for host, starting with a '/'.
- standard SMTP client. It's common to use Unix sockets for LMTP, so our
- :meth:
connect
method must support that as well as a regular host:port - server. local_hostname has the same meaning as it does for the
- :class:
SMTP
class. To specify a Unix socket, you must use an absolute - path for host, starting with a '/'.
- Authentication is supported, using the regular SMTP mechanism. When using a Unix
- socket, LMTP generally don't support or require any authentication, but your
- mileage might vary.
- Authentication is supported, using the regular SMTP mechanism. When using a
- Unix socket, LMTP generally don't support or require any authentication, but
- your mileage might vary. .. versionadded:: 2.6
--- a/Lib/smtplib.py
+++ b/Lib/smtplib.py
@@ -238,11 +238,11 @@ class SMTP:
If specified, host' is the name of the remote host to which to[](#l2.4) connect. If specified,
port' specifies the port to which to connect.
By default, smtplib.SMTP_PORT is used. If a host is specified the
connect method is called, and if it returns anything other than[](#l2.7)
a success code an SMTPConnectError is raised. If specified,[](#l2.8)
connect method is called, and if it returns anything other than a[](#l2.9)
success code an SMTPConnectError is raised. If specified,[](#l2.10) `local_hostname` is used as the FQDN of the local host for the[](#l2.11)
HELO/EHLO command. Otherwise,[](#l2.12)
the local hostname is found using socket.getfqdn().[](#l2.13)
HELO/EHLO command. Otherwise, the local hostname is found using[](#l2.14)
socket.getfqdn().[](#l2.15)
""" self.timeout = timeout @@ -760,13 +760,15 @@ class SMTP: if _have_ssl: class SMTP_SSL(SMTP):
""" This is a subclass derived from SMTP that connects over an SSL encrypted[](#l2.23)
socket (to use this class you need a socket module that was compiled with SSL[](#l2.24)
support). If host is not specified, '' (the local host) is used. If port is[](#l2.25)
omitted, the standard SMTP-over-SSL port (465) is used. local_hostname[](#l2.26)
has the same meaning as it does in the SMTP class. keyfile and certfile[](#l2.27)
are also optional - they can contain a PEM formatted private key and[](#l2.28)
certificate chain file for the SSL connection.[](#l2.29)
""" This is a subclass derived from SMTP that connects over an SSL[](#l2.30)
encrypted socket (to use this class you need a socket module that was[](#l2.31)
compiled with SSL support). If host is not specified, '' (the local[](#l2.32)
host) is used. If port is omitted, the standard SMTP-over-SSL port[](#l2.33)
(465) is used. local_hostname has the same meaning as it does in the[](#l2.34)
SMTP class. keyfile and certfile are also optional - they can contain[](#l2.35)
a PEM formatted private key and certificate chain file for the SSL[](#l2.36)
connection.[](#l2.37)
+ """ default_port = SMTP_SSL_PORT @@ -797,10 +799,10 @@ class LMTP(SMTP): """LMTP - Local Mail Transfer Protocol The LMTP protocol, which is very similar to ESMTP, is heavily based
- on the standard SMTP client. It's common to use Unix sockets for LMTP,
- so our connect() method must support that as well as a regular
- host:port server. local_hostname has the same meaning as it does in the
- SMTP class. To specify a Unix socket, you must use an absolute
- on the standard SMTP client. It's common to use Unix sockets for
- LMTP, so our connect() method must support that as well as a regular
- host:port server. local_hostname has the same meaning as it does in
- the SMTP class. To specify a Unix socket, you must use an absolute path as the host, starting with a '/'. Authentication is supported, using the regular SMTP mechanism. When