Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`mail`.`interfaces`.`IMessageDelivery``

interface documentation

`class IMessageDelivery(Interface): (source)`

Known implementations: `twisted.mail.protocols.DomainDeliveryBase`

View In Hierarchy

Undocumented

Method | `receivedHeader` | Generate the Received header for a message.
Method | `validateFrom` | Validate the address from which the message originates.
Method | `validateTo` | Validate the address for which the message is destined.

def receivedHeader(helo, origin, recipients): (source)

Generate the Received header for a message.

Parameters
helo:2-`tuple` of `bytes` and `bytes`. | The argument to the HELO command and the client's IP address.
origin:`Address` | The address the message is from
recipients:`list` of `User` | A list of the addresses for which this message is bound.
Returns
`bytes` | The full `"Received"` header string.

def validateFrom(helo, origin): (source)

Validate the address from which the message originates.

Parameters
helo:2-`tuple` of `bytes` and `bytes`. | The argument to the HELO command and the client's IP address.
origin:`Address` | The address the message is from
Returns
`Deferred` or `Address` | `origin` or a `Deferred` whose callback will be passed `origin`.
Raises
`SMTPBadSender` | Raised of messages from this address are not to be accepted.

def validateTo(user): (source)

Validate the address for which the message is destined.

Parameters
user:`User` | The address to validate.
Returns
no-argument callable | A `Deferred` which becomes, or a callable which takes no arguments and returns an object implementing `IMessageSMTP`. This will be called and the returned object used to deliver the message when it arrives.
Raises
`SMTPBadRcpt` | Raised if messages to the address are not to be accepted.