smtpd (version Python SMTP proxy version 0.2)
index
/usr/local/bin/smtpd.py

An RFC 2821 smtp proxy.
 
Usage: %(program)s [options] [localhost:localport [remotehost:remoteport]]
 
Options:
 
    --nosetuid
    -n
        This program generally tries to setuid `nobody', unless this flag is
        set.  The setuid call will fail if this program is not run as root (in
        which case, use this flag).
 
    --version
    -V
        Print the version number and exit.
 
    --class classname
    -c classname
        Use `classname' as the concrete SMTP proxy class.  Uses `PureProxy' by
        default.
 
    --debug
    -d
        Turn on debugging prints.
 
    --help
    -h
        Print this message and exit.
 
Version: %(__version__)s
 
If localhost is not given then `localhost' is used, and if localport is not
given then 8025 is used.  If remotehost is not given then `localhost' is used,
and if remoteport is not given, then 25 is used.

 
Modules
       
asynchat
asyncore
errno
getopt
os
socket
sys
time

 
Classes
       
asyncore.dispatcher
SMTPServer
DebuggingServer
PureProxy
MailmanProxy

 
class DebuggingServer(SMTPServer)
    
Method resolution order:
DebuggingServer
SMTPServer
asyncore.dispatcher

Methods defined here:
process_message(self, peer, mailfrom, rcpttos, data)
# Do something with the gathered message

Methods inherited from SMTPServer:
__init__(self, localaddr, remoteaddr)
handle_accept(self)

Methods inherited from asyncore.dispatcher:
__getattr__(self, attr)
# cheap inheritance, used to pass all other attribute
# references to the underlying socket object.
__repr__(self)
accept(self)
add_channel(self, map=None)
bind(self, addr)
close(self)
connect(self, address)
create_socket(self, family, type)
del_channel(self, map=None)
handle_close(self)
handle_connect(self)
handle_error(self)
handle_expt(self)
handle_expt_event(self)
handle_read(self)
handle_read_event(self)
handle_write(self)
handle_write_event(self)
listen(self, num)
log(self, message)
log_info(self, message, type='info')
readable(self)
recv(self, buffer_size)
send(self, data)
set_reuse_addr(self)
set_socket(self, sock, map=None)
writable(self)

Data and other attributes inherited from asyncore.dispatcher:
accepting = False
addr = None
closing = False
connected = False
debug = False

 
class MailmanProxy(PureProxy)
    
Method resolution order:
MailmanProxy
PureProxy
SMTPServer
asyncore.dispatcher

Methods defined here:
process_message(self, peer, mailfrom, rcpttos, data)

Methods inherited from SMTPServer:
__init__(self, localaddr, remoteaddr)
handle_accept(self)

Methods inherited from asyncore.dispatcher:
__getattr__(self, attr)
# cheap inheritance, used to pass all other attribute
# references to the underlying socket object.
__repr__(self)
accept(self)
add_channel(self, map=None)
bind(self, addr)
close(self)
connect(self, address)
create_socket(self, family, type)
del_channel(self, map=None)
handle_close(self)
handle_connect(self)
handle_error(self)
handle_expt(self)
handle_expt_event(self)
handle_read(self)
handle_read_event(self)
handle_write(self)
handle_write_event(self)
listen(self, num)
log(self, message)
log_info(self, message, type='info')
readable(self)
recv(self, buffer_size)
send(self, data)
set_reuse_addr(self)
set_socket(self, sock, map=None)
writable(self)

Data and other attributes inherited from asyncore.dispatcher:
accepting = False
addr = None
closing = False
connected = False
debug = False

 
class PureProxy(SMTPServer)
    
Method resolution order:
PureProxy
SMTPServer
asyncore.dispatcher

Methods defined here:
process_message(self, peer, mailfrom, rcpttos, data)

Methods inherited from SMTPServer:
__init__(self, localaddr, remoteaddr)
handle_accept(self)

Methods inherited from asyncore.dispatcher:
__getattr__(self, attr)
# cheap inheritance, used to pass all other attribute
# references to the underlying socket object.
__repr__(self)
accept(self)
add_channel(self, map=None)
bind(self, addr)
close(self)
connect(self, address)
create_socket(self, family, type)
del_channel(self, map=None)
handle_close(self)
handle_connect(self)
handle_error(self)
handle_expt(self)
handle_expt_event(self)
handle_read(self)
handle_read_event(self)
handle_write(self)
handle_write_event(self)
listen(self, num)
log(self, message)
log_info(self, message, type='info')
readable(self)
recv(self, buffer_size)
send(self, data)
set_reuse_addr(self)
set_socket(self, sock, map=None)
writable(self)

Data and other attributes inherited from asyncore.dispatcher:
accepting = False
addr = None
closing = False
connected = False
debug = False

 
class SMTPServer(asyncore.dispatcher)
     Methods defined here:
__init__(self, localaddr, remoteaddr)
handle_accept(self)
process_message(self, peer, mailfrom, rcpttos, data)
Override this abstract method to handle messages from the client.
 
peer is a tuple containing (ipaddr, port) of the client that made the
socket connection to our smtp port.
 
mailfrom is the raw address the client claims the message is coming
from.
 
rcpttos is a list of raw addresses the client wishes to deliver the
message to.
 
data is a string containing the entire full text of the message,
headers (if supplied) and all.  It has been `de-transparencied'
according to RFC 821, Section 4.5.2.  In other words, a line
containing a `.' followed by other text has had the leading dot
removed.
 
This function should return None, for a normal `250 Ok' response;
otherwise it returns the desired response string in RFC 821 format.

Methods inherited from asyncore.dispatcher:
__getattr__(self, attr)
# cheap inheritance, used to pass all other attribute
# references to the underlying socket object.
__repr__(self)
accept(self)
add_channel(self, map=None)
bind(self, addr)
close(self)
connect(self, address)
create_socket(self, family, type)
del_channel(self, map=None)
handle_close(self)
handle_connect(self)
handle_error(self)
handle_expt(self)
handle_expt_event(self)
handle_read(self)
handle_read_event(self)
handle_write(self)
handle_write_event(self)
listen(self, num)
log(self, message)
log_info(self, message, type='info')
readable(self)
recv(self, buffer_size)
send(self, data)
set_reuse_addr(self)
set_socket(self, sock, map=None)
writable(self)

Data and other attributes inherited from asyncore.dispatcher:
accepting = False
addr = None
closing = False
connected = False
debug = False

 
Data
        __all__ = ['SMTPServer', 'DebuggingServer', 'PureProxy', 'MailmanProxy']
__version__ = 'Python SMTP proxy version 0.2'