Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
SMTPServer Class Reference
Inheritance diagram for SMTPServer:
dispatcher DebuggingServer PureProxy MailmanProxy

Public Member Functions

def __init__
 
def handle_accept
 
def process_message
 
- Public Member Functions inherited from dispatcher
def __init__
 
def __repr__
 
def add_channel
 
def del_channel
 
def create_socket
 
def set_socket
 

Additional Inherited Members

- Data Fields inherited from dispatcher
 connected
 
 socket
 
 family_and_type
 
- Static Public Attributes inherited from dispatcher
int debug = 0
 
int connected = 0
 
int accepting = 0
 
int closing = 0
 
 addr = None
 

Detailed Description

Definition at line 275 of file smtpd.py.

Constructor & Destructor Documentation

def __init__ (   self,
  localaddr,
  remoteaddr 
)

Definition at line 276 of file smtpd.py.

References dispatcher.__init__(), SMTPServer._localaddr, SMTPServer._remoteaddr, and dispatcher.create_socket().

277  def __init__(self, localaddr, remoteaddr):
278  self._localaddr = localaddr
279  self._remoteaddr = remoteaddr
281  self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
282  # try to re-use a server port if possible
283  self.set_reuse_addr()
284  self.bind(localaddr)
285  self.listen(5)
286  print >> DEBUGSTREAM, \
287  '%s started at %s\n\tLocal addr: %s\n\tRemote addr:%s' % (
288  self.__class__.__name__, time.ctime(time.time()),
289  localaddr, remoteaddr)

Member Function Documentation

def handle_accept (   self)

Definition at line 290 of file smtpd.py.

References _socketobject.accept().

291  def handle_accept(self):
292  conn, addr = self.accept()
293  print >> DEBUGSTREAM, 'Incoming connection from %s' % repr(addr)
294  channel = SMTPChannel(self, conn, addr)
def 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.

Definition at line 296 of file smtpd.py.

297  def process_message(self, peer, mailfrom, rcpttos, data):
298  """Override this abstract method to handle messages from the client.
299 
300  peer is a tuple containing (ipaddr, port) of the client that made the
301  socket connection to our smtp port.
302 
303  mailfrom is the raw address the client claims the message is coming
304  from.
305 
306  rcpttos is a list of raw addresses the client wishes to deliver the
307  message to.
308 
309  data is a string containing the entire full text of the message,
310  headers (if supplied) and all. It has been `de-transparencied'
311  according to RFC 821, Section 4.5.2. In other words, a line
312  containing a `.' followed by other text has had the leading dot
313  removed.
314 
315  This function should return None, for a normal `250 Ok' response;
316  otherwise it returns the desired response string in RFC 821 format.
317 
318  """
319  raise NotImplementedError
320 
321 

The documentation for this class was generated from the following file: