blob: 657050d04e8362cff56538ea896f5625cbc7c20c [file] [log] [blame]
Fred Drake2363e8f2004-07-11 16:25:25 +00001\section{\module{smtpd} ---
2 SMTP Server}
3
4\declaremodule{standard}{smtpd}
5
6\moduleauthor{Barry Warsaw}{barry@zope.com}
7\sectionauthor{Moshe Zadka}{moshez@moshez.org}
8
9\modulesynopsis{Implement a flexible SMTP server}
10
11This module offers several classes to implement SMTP servers. One is
12a generic do-nothing implementation, which can be overridden, while
13the other two offer specific mail-sending strategies.
14
15
16\subsection{SMTPServer Objects}
17
18\begin{classdesc}{SMTPServer}{localaddr, remoteaddr}
19Create a new \class{SMTPServer} object, which binds to local address
20\var{localaddr}. It will treat \var{remoteaddr} as an upstream SMTP
21relayer. It inherits from \class{asyncore.dispatcher}, and so will
22insert itself into \refmodule{asyncore}'s event loop on instantiation.
23\end{classdesc}
24
25\begin{methoddesc}[SMTPServer]{process_message}{peer, mailfrom, rcpttos, data}
26Raise \exception{NotImplementedError} exception. Override this in
27subclasses to do something useful with this message. Whatever was
28passed in the constructor as \var{remoteaddr} will be available as the
29\member{_remoteaddr} attribute. \var{peer} is the remote host's address,
30\var{mailfrom} is the envelope originator, \var{rcpttos} are the
31envelope recipients and \var{data} is a string containing the contents
32of the e-mail (which should be in \rfc{2822} format).
33\end{methoddesc}
34
35
36\subsection{DebuggingServer Objects}
37
38\begin{classdesc}{DebuggingServer}{localaddr, remoteaddr}
39Create a new debugging server. Arguments are as per
40\class{SMTPServer}. Messages will be discarded, and printed on
41stdout.
42\end{classdesc}
43
44
45\subsection{PureProxy Objects}
46
47\begin{classdesc}{PureProxy}{localaddr, remoteaddr}
48Create a new pure proxy server. Arguments are as per \class{SMTPServer}.
49Everything will be relayed to \var{remoteaddr}. Note that running
50this has a good chance to make you into an open relay, so please be
51careful.
52\end{classdesc}
53
54
55\subsection{MailmanProxy Objects}
56
57\begin{classdesc}{MailmanProxy}{localaddr, remoteaddr}
58Create a new pure proxy server. Arguments are as per
59\class{SMTPServer}. Everything will be relayed to \var{remoteaddr},
60unless local mailman configurations knows about an address, in which
61case it will be handled via mailman. Note that running this has a
62good chance to make you into an open relay, so please be careful.
63\end{classdesc}