summaryrefslogtreecommitdiffstats
path: root/Doc/library
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2013-06-07 14:21:41 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2013-06-07 14:21:41 (GMT)
commit30298b468b1c702bf3082b57fea13247e53e2ae2 (patch)
tree4ea40ceefc58a21b612ee0da3de1a32663f28ca1 /Doc/library
parent4e694d6fa9f1fbdf1de137214deceac4cd87e091 (diff)
downloadcpython-30298b468b1c702bf3082b57fea13247e53e2ae2.zip
cpython-30298b468b1c702bf3082b57fea13247e53e2ae2.tar.gz
cpython-30298b468b1c702bf3082b57fea13247e53e2ae2.tar.bz2
Closes #11959: SMTPServer and SMTPChannel now take an optional map, use of which avoids affecting global state.
Diffstat (limited to 'Doc/library')
-rw-r--r--Doc/library/smtpd.rst19
1 files changed, 17 insertions, 2 deletions
diff --git a/Doc/library/smtpd.rst b/Doc/library/smtpd.rst
index 2ca71ff..2c2df8a 100644
--- a/Doc/library/smtpd.rst
+++ b/Doc/library/smtpd.rst
@@ -27,7 +27,8 @@ SMTPServer Objects
------------------
-.. class:: SMTPServer(localaddr, remoteaddr, data_size_limit=33554432)
+.. class:: SMTPServer(localaddr, remoteaddr, data_size_limit=33554432,
+ map=None)
Create a new :class:`SMTPServer` object, which binds to local address
*localaddr*. It will treat *remoteaddr* as an upstream SMTP relayer. It
@@ -38,6 +39,8 @@ SMTPServer Objects
accepted in a ``DATA`` command. A value of ``None`` or ``0`` means no
limit.
+ A dictionary can be specified in *map* to avoid using a global socket map.
+
.. method:: process_message(peer, mailfrom, rcpttos, data)
Raise :exc:`NotImplementedError` exception. Override this in subclasses to
@@ -53,6 +56,9 @@ SMTPServer Objects
Override this in subclasses to use a custom :class:`SMTPChannel` for
managing SMTP clients.
+ .. versionchanged:: 3.4
+ The *map* argument was added.
+
DebuggingServer Objects
-----------------------
@@ -90,11 +96,20 @@ MailmanProxy Objects
SMTPChannel Objects
-------------------
-.. class:: SMTPChannel(server, conn, addr)
+.. class:: SMTPChannel(server, conn, addr, data_size_limit=33554432,
+ map=None))
Create a new :class:`SMTPChannel` object which manages the communication
between the server and a single SMTP client.
+ *conn* and *addr* are as per the instance variables described below.
+
+ *data_size_limit* specifies the maximum number of bytes that will be
+ accepted in a ``DATA`` command. A value of ``None`` or ``0`` means no
+ limit.
+
+ A dictionary can be specified in *map* to avoid using a global socket map.
+
To use a custom SMTPChannel implementation you need to override the
:attr:`SMTPServer.channel_class` of your :class:`SMTPServer`.