summaryrefslogtreecommitdiff
path: root/Doc/library/smtpd.rst
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2007-08-15 14:28:22 +0000
committerGeorg Brandl <georg@python.org>2007-08-15 14:28:22 +0000
commite395d9483cba40d328a49a42c75b79e3ef1dd770 (patch)
tree3a26ee506c46066878a5705f213c08e17e6ce6a1 /Doc/library/smtpd.rst
parent4e5cab59a9f2efc1f3cece227b49f79c3c830bbd (diff)
downloadcpython-e395d9483cba40d328a49a42c75b79e3ef1dd770.tar.gz
Move the 3k reST doc tree in place.
Diffstat (limited to 'Doc/library/smtpd.rst')
-rw-r--r--Doc/library/smtpd.rst72
1 files changed, 72 insertions, 0 deletions
diff --git a/Doc/library/smtpd.rst b/Doc/library/smtpd.rst
new file mode 100644
index 0000000000..8927a64f4e
--- /dev/null
+++ b/Doc/library/smtpd.rst
@@ -0,0 +1,72 @@
+:mod:`smtpd` --- SMTP Server
+============================
+
+.. module:: smtpd
+ :synopsis: A SMTP server implementation in Python.
+
+.. moduleauthor:: Barry Warsaw <barry@zope.com>
+.. sectionauthor:: Moshe Zadka <moshez@moshez.org>
+
+
+
+
+This module offers several classes to implement SMTP servers. One is a generic
+do-nothing implementation, which can be overridden, while the other two offer
+specific mail-sending strategies.
+
+
+SMTPServer Objects
+------------------
+
+
+.. class:: SMTPServer(localaddr, remoteaddr)
+
+ Create a new :class:`SMTPServer` object, which binds to local address
+ *localaddr*. It will treat *remoteaddr* as an upstream SMTP relayer. It
+ inherits from :class:`asyncore.dispatcher`, and so will insert itself into
+ :mod:`asyncore`'s event loop on instantiation.
+
+
+.. method:: SMTPServer.process_message(peer, mailfrom, rcpttos, data)
+
+ Raise :exc:`NotImplementedError` exception. Override this in subclasses to do
+ something useful with this message. Whatever was passed in the constructor as
+ *remoteaddr* will be available as the :attr:`_remoteaddr` attribute. *peer* is
+ the remote host's address, *mailfrom* is the envelope originator, *rcpttos* are
+ the envelope recipients and *data* is a string containing the contents of the
+ e-mail (which should be in :rfc:`2822` format).
+
+
+DebuggingServer Objects
+-----------------------
+
+
+.. class:: DebuggingServer(localaddr, remoteaddr)
+
+ Create a new debugging server. Arguments are as per :class:`SMTPServer`.
+ Messages will be discarded, and printed on stdout.
+
+
+PureProxy Objects
+-----------------
+
+
+.. class:: PureProxy(localaddr, remoteaddr)
+
+ Create a new pure proxy server. Arguments are as per :class:`SMTPServer`.
+ Everything will be relayed to *remoteaddr*. Note that running this has a good
+ chance to make you into an open relay, so please be careful.
+
+
+MailmanProxy Objects
+--------------------
+
+
+.. class:: MailmanProxy(localaddr, remoteaddr)
+
+ Create a new pure proxy server. Arguments are as per :class:`SMTPServer`.
+ Everything will be relayed to *remoteaddr*, unless local mailman configurations
+ knows about an address, in which case it will be handled via mailman. Note that
+ running this has a good chance to make you into an open relay, so please be
+ careful.
+