Package lamson :: Module server :: Class SMTPReceiver
[hide private]
[frames] | no frames]

Class SMTPReceiver

source code


Receives emails and hands it to the Router for further processing.

Instance Methods [hide private]
 
__init__(self, host='127.0.0.1', port=8825)
Initializes to bind on the given port and host/ipaddress.
source code
 
start(self)
Kicks everything into gear and starts listening on the port.
source code
 
process_message(self, Peer, From, To, Data)
Called by smtpd.SMTPServer when there's a message received.
source code
 
close(self)
Doesn't do anything except log who called this, since nobody should.
source code

Inherited from smtpd.SMTPServer: handle_accept

Inherited from asyncore.dispatcher: __getattr__, __repr__, accept, add_channel, bind, connect, create_socket, del_channel, handle_close, handle_connect, handle_connect_event, handle_error, handle_expt, handle_expt_event, handle_read, handle_read_event, handle_write, handle_write_event, listen, log, log_info, readable, recv, send, set_reuse_addr, set_socket, writable

Class Variables [hide private]

Inherited from asyncore.dispatcher: accepting, addr, closing, connected, debug, ignore_log_types

Method Details [hide private]

__init__(self, host='127.0.0.1', port=8825)
(Constructor)

source code 

Initializes to bind on the given port and host/ipaddress. Typically in deployment you'd give 0.0.0.0 for "all internet devices" but consult your operating system.

This uses smtpd.SMTPServer in the __init__, which means that you have to call this far after you use python-daemonize or else daemonize will close the socket.

Overrides: asyncore.dispatcher.__init__

start(self)

source code 

Kicks everything into gear and starts listening on the port. This fires off threads and waits until they are done.

process_message(self, Peer, From, To, Data)

source code 

Called by smtpd.SMTPServer when there's a message received.

Overrides: smtpd.SMTPServer.process_message

close(self)

source code 

Doesn't do anything except log who called this, since nobody should. Ever.

Overrides: asyncore.dispatcher.close