cinap_lenrekadd hg and python4bb9e2215 years agoHistory
63 lines · 2.3 KB · TeX
RawDownload
\section{\module{smtpd} ---         SMTP Server} \declaremodule{standard}{smtpd} \moduleauthor{Barry Warsaw}{barry@zope.com}\sectionauthor{Moshe Zadka}{moshez@moshez.org} \modulesynopsis{Implement a flexible SMTP server} This module offers several classes to implement SMTP servers.  One isa generic do-nothing implementation, which can be overridden, whilethe other two offer specific mail-sending strategies.  \subsection{SMTPServer Objects} \begin{classdesc}{SMTPServer}{localaddr, remoteaddr}Create a new \class{SMTPServer} object, which binds to local address\var{localaddr}.  It will treat \var{remoteaddr} as an upstream SMTPrelayer.  It inherits from \class{asyncore.dispatcher}, and so willinsert itself into \refmodule{asyncore}'s event loop on instantiation.\end{classdesc} \begin{methoddesc}[SMTPServer]{process_message}{peer, mailfrom, rcpttos, data}Raise \exception{NotImplementedError} exception. Override this insubclasses to do something useful with this message. Whatever waspassed in the constructor as \var{remoteaddr} will be available as the\member{_remoteaddr} attribute. \var{peer} is the remote host's address,\var{mailfrom} is the envelope originator, \var{rcpttos} are theenvelope recipients and \var{data} is a string containing the contentsof the e-mail (which should be in \rfc{2822} format).\end{methoddesc}  \subsection{DebuggingServer Objects} \begin{classdesc}{DebuggingServer}{localaddr, remoteaddr}Create a new debugging server.  Arguments are as per\class{SMTPServer}.  Messages will be discarded, and printed onstdout.\end{classdesc}  \subsection{PureProxy Objects} \begin{classdesc}{PureProxy}{localaddr, remoteaddr}Create a new pure proxy server. Arguments are as per \class{SMTPServer}.Everything will be relayed to \var{remoteaddr}.  Note that runningthis has a good chance to make you into an open relay, so please becareful.\end{classdesc}  \subsection{MailmanProxy Objects} \begin{classdesc}{MailmanProxy}{localaddr, remoteaddr}Create a new pure proxy server. Arguments are as per\class{SMTPServer}.  Everything will be relayed to \var{remoteaddr},unless local mailman configurations knows about an address, in whichcase it will be handled via mailman.  Note that running this has agood chance to make you into an open relay, so please be careful.\end{classdesc}