# ``twisted`.`mail`.`relaymanager`.`_AttemptManager``

class documentation

`class _AttemptManager: (source)`

View In Hierarchy

A manager for an attempt to relay a set of messages to a mail exchange server.

Method | `__init__` |
Method | `getCompletionDeferred` | Return a deferred which will fire when the attempt to relay is finished.
Method | `notifyDone` | When the connection is lost or cannot be established, prepare to resend unsent messages and fire all deferred which are waiting for the completion of the attempt to relay.
Method | `notifyFailure` | Generate a bounce message for a message which cannot be relayed.
Method | `notifyNoConnection` | When a connection to the mail exchange server cannot be established, prepare to resend messages later.
Method | `notifySuccess` | Remove a message from the relay queue after it has been successfully sent.
Instance Variable | `manager` | See `__init__`
Instance Variable | `noisy` | Undocumented
Instance Variable | `reactor` | Undocumented
Method | `_finish` | Remove a message from the relay queue and from the smart host's list of messages being relayed.
Instance Variable | `_completionDeferreds` | Deferreds which are to be notified when the attempt to relay is finished.

def __init__(self, manager, noisy=True, reactor=None): (source)

Parameters
manager:`SmartHostSMTPRelayingManager` | A smart host.
noisy:`bool` | A flag which determines whether informational log messages will be generated (`True`) or not (`False`).
reactor:`IReactorTime` provider | A reactor which will be used to schedule delayed calls.

def getCompletionDeferred(self): (source)
Return a deferred which will fire when the attempt to relay is finished.

Returns
`Deferred` | A deferred which will fire when the attempt to relay is finished.

def notifyDone(self, relay): (source)
When the connection is lost or cannot be established, prepare to resend unsent messages and fire all deferred which are waiting for the completion of the attempt to relay.

Parameters
relay:`SMTPManagedRelayerFactory` | The factory for the relayer for the connection.

def notifyFailure(self, relay, message): (source)
Generate a bounce message for a message which cannot be relayed.

Parameters
relay:`SMTPManagedRelayerFactory` | The factory for the relayer responsible for the message.
message:`bytes` | The path of the file holding the message.

def notifyNoConnection(self, relay): (source)
When a connection to the mail exchange server cannot be established, prepare to resend messages later.

Parameters
relay:`SMTPManagedRelayerFactory` | The factory for the relayer meant to use the connection.

def notifySuccess(self, relay, message): (source)
Remove a message from the relay queue after it has been successfully sent.

Parameters
relay:`SMTPManagedRelayerFactory` | The factory for the relayer which sent the message.
message:`bytes` | The path of the file holding the message.

manager = (source)
See `__init__`
noisy = (source)

Undocumented

reactor = (source)

Undocumented

def _finish(self, relay, message): (source)
Remove a message from the relay queue and from the smart host's list of messages being relayed.

Parameters
relay:`SMTPManagedRelayerFactory` | The factory for the relayer which sent the message.
message:`bytes` | The path of the file holding the message.

_completionDeferreds: `list` of `Deferred` = (source)
Deferreds which are to be notified when the attempt to relay is finished.