Package twisted :: Package mail :: Module relaymanager :: Class SmartHostSMTPRelayingManager
[frames | no frames]

Class SmartHostSMTPRelayingManager

Known Subclasses:
SmartHostESMTPRelayingManager

Manage SMTP Relayers

Manage SMTP relayers, keeping track of the existing connections, each connection's responsibility in term of messages. Create more relayers if the need arises.

Someone should press .checkState periodically
Method Summary
  __init__(self, queue, maxConnections, maxMessagesPerConnection)
  __getstate__(self)
(internal) delete volatile state
  __setstate__(self, state)
(internal) restore volatile state
  _cbExchange(self, address, port, factory)
  _checkStateMX(self)
  _ebExchange(self, failure, factory, domain)
  _finish(self, relay, message)
  checkState(self)
call me periodically to check I am still up to date
  notifyDone(self, relay)
A relaying SMTP client is disconnected.
  notifyFailure(self, relay, message)
Relaying the message has failed.
  notifyNoConnection(self, relay)
Relaying SMTP client couldn't connect.
  notifySuccess(self, relay, message)
a relay sent a message successfully

Instance Variable Summary
class factory = twisted.mail.relaymanager.SMTPManagedRelayerFactory
  fArgs: Additional positional arguments used to instantiate factory.
  fKwArgs: Additional keyword arguments used to instantiate factory.

Class Variable Summary
NoneType mxcalc = None                                                                  
int PORT = 25                                                                    

Method Details

__init__(self, queue, maxConnections=2, maxMessagesPerConnection=10)
(Constructor)

Parameters:
queue - The object used to queue messages on their way to delivery.
           (type=Any implementor of IQueue)
maxConnections - The maximum number of SMTP connections to allow to be opened at any given time.
           (type=int)
maxMessagesPerConnection -

The maximum number of messages a relayer will be given responsibility for.

Default values are meant for a small box with 1-5 users.
           (type=int)

__getstate__(self)

(internal) delete volatile state

__setstate__(self, state)

(internal) restore volatile state

checkState(self)

call me periodically to check I am still up to date

synchronize with the state of the world, and maybe launch a new relay

notifyDone(self, relay)

A relaying SMTP client is disconnected.

unmark all pending messages under this relay's resposibility as being relayed, and remove the relay.

notifyFailure(self, relay, message)

Relaying the message has failed.

notifyNoConnection(self, relay)

Relaying SMTP client couldn't connect.

Useful because it tells us our upstream server is unavailable.

notifySuccess(self, relay, message)

a relay sent a message successfully

Mark it as sent in our lists

Instance Variable Details

fArgs

Additional positional arguments used to instantiate factory.

fKwArgs

Additional keyword arguments used to instantiate factory.

Class Variable Details

mxcalc

Type:
NoneType
Value:
None                                                                  

PORT

Type:
int
Value:
25                                                                    

Generated by Epydoc 2.0 on Sat May 15 20:08:33 2004 http://epydoc.sf.net