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`.`bounce``

module documentation
(source)

Support for bounce message generation.

Function | `generateBounce` | Generate a bounce message for an undeliverable email message.
Constant | `BOUNCE_FORMAT` | Undocumented

def generateBounce(message, failedFrom, failedTo, transcript='', encoding='utf-8'): (source)

Generate a bounce message for an undeliverable email message.

Parameters
message:a file-like object | The undeliverable message.
failedFrom:`bytes` or `unicode` | The originator of the undeliverable message.
failedTo:`bytes` or `unicode` | The destination of the undeliverable message.
transcript:`bytes` or `unicode` | An error message to include in the bounce message.
encoding:`str` or `unicode` | Encoding to use, default: utf-8
Returns
3-`tuple` of (1) `bytes`, (2) `bytes`, (3) `bytes` | The originator, the destination and the contents of the bounce message. The destination of the bounce message is the originator of the undeliverable message.

BOUNCE_FORMAT: `str` = (source)

Undocumented

Value

    '''From: postmaster@{failedDomain}
    To: {failedFrom}
    Subject: Returned Mail: see transcript for details
    Message-ID: {messageID}
    Content-Type: multipart/report; report-type=delivery-status;
        boundary="{boundary}"

    ...