MailManager

2024/10/14 - MailManager - 6 updated api methods

Changes  Mail Manager support for viewing and exporting metadata of archived messages.

GetArchiveExport (updated) Link ¶
Changes (response)
{'Filters': {'Include': {'StringExpression': {'Evaluate': {'Attribute': {'ENVELOPE_FROM',
                                                                         'ENVELOPE_TO'}}}},
             'Unless': {'StringExpression': {'Evaluate': {'Attribute': {'ENVELOPE_FROM',
                                                                        'ENVELOPE_TO'}}}}}}

Retrieves the details and current status of a specific email archive export job.

See also: AWS API Documentation

Request Syntax

client.get_archive_export(
    ExportId='string'
)
type ExportId:

string

param ExportId:

[REQUIRED]

The identifier of the export job to get details for.

rtype:

dict

returns:

Response Syntax

{
    'ArchiveId': 'string',
    'ExportDestinationConfiguration': {
        'S3': {
            'S3Location': 'string'
        }
    },
    'Filters': {
        'Include': [
            {
                'BooleanExpression': {
                    'Evaluate': {
                        'Attribute': 'HAS_ATTACHMENTS'
                    },
                    'Operator': 'IS_TRUE'|'IS_FALSE'
                },
                'StringExpression': {
                    'Evaluate': {
                        'Attribute': 'TO'|'FROM'|'CC'|'SUBJECT'|'ENVELOPE_TO'|'ENVELOPE_FROM'
                    },
                    'Operator': 'CONTAINS',
                    'Values': [
                        'string',
                    ]
                }
            },
        ],
        'Unless': [
            {
                'BooleanExpression': {
                    'Evaluate': {
                        'Attribute': 'HAS_ATTACHMENTS'
                    },
                    'Operator': 'IS_TRUE'|'IS_FALSE'
                },
                'StringExpression': {
                    'Evaluate': {
                        'Attribute': 'TO'|'FROM'|'CC'|'SUBJECT'|'ENVELOPE_TO'|'ENVELOPE_FROM'
                    },
                    'Operator': 'CONTAINS',
                    'Values': [
                        'string',
                    ]
                }
            },
        ]
    },
    'FromTimestamp': datetime(2015, 1, 1),
    'MaxResults': 123,
    'Status': {
        'CompletionTimestamp': datetime(2015, 1, 1),
        'ErrorMessage': 'string',
        'State': 'QUEUED'|'PREPROCESSING'|'PROCESSING'|'COMPLETED'|'FAILED'|'CANCELLED',
        'SubmissionTimestamp': datetime(2015, 1, 1)
    },
    'ToTimestamp': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    The response containing details of the specified archive export job.

    • ArchiveId (string) --

      The identifier of the archive the email export was performed from.

    • ExportDestinationConfiguration (dict) --

      Where the exported emails are being delivered.

      • S3 (dict) --

        Configuration for delivering to an Amazon S3 bucket.

        • S3Location (string) --

          The S3 location to deliver the exported email data.

    • Filters (dict) --

      The criteria used to filter emails included in the export.

      • Include (list) --

        The filter conditions for emails to include.

        • (dict) --

          A filter condition used to include or exclude emails when exporting from or searching an archive.

          • BooleanExpression (dict) --

            A boolean expression to evaluate against email attributes.

            • Evaluate (dict) --

              The email attribute value to evaluate.

              • Attribute (string) --

                The name of the email attribute to evaluate.

            • Operator (string) --

              The boolean operator to use for evaluation.

          • StringExpression (dict) --

            A string expression to evaluate against email attributes.

            • Evaluate (dict) --

              The attribute of the email to evaluate.

              • Attribute (string) --

                The name of the email attribute to evaluate.

            • Operator (string) --

              The operator to use when evaluating the string values.

            • Values (list) --

              The list of string values to evaluate the email attribute against.

              • (string) --

      • Unless (list) --

        The filter conditions for emails to exclude.

        • (dict) --

          A filter condition used to include or exclude emails when exporting from or searching an archive.

          • BooleanExpression (dict) --

            A boolean expression to evaluate against email attributes.

            • Evaluate (dict) --

              The email attribute value to evaluate.

              • Attribute (string) --

                The name of the email attribute to evaluate.

            • Operator (string) --

              The boolean operator to use for evaluation.

          • StringExpression (dict) --

            A string expression to evaluate against email attributes.

            • Evaluate (dict) --

              The attribute of the email to evaluate.

              • Attribute (string) --

                The name of the email attribute to evaluate.

            • Operator (string) --

              The operator to use when evaluating the string values.

            • Values (list) --

              The list of string values to evaluate the email attribute against.

              • (string) --

    • FromTimestamp (datetime) --

      The start of the timestamp range the exported emails cover.

    • MaxResults (integer) --

      The maximum number of email items included in the export.

    • Status (dict) --

      The current status of the export job.

      • CompletionTimestamp (datetime) --

        The timestamp of when the export job completed (if finished).

      • ErrorMessage (string) --

        An error message if the export job failed.

      • State (string) --

        The current state of the export job.

      • SubmissionTimestamp (datetime) --

        The timestamp of when the export job was submitted.

    • ToTimestamp (datetime) --

      The end of the date range the exported emails cover.

GetArchiveMessage (updated) Link ¶
Changes (response)
{'Envelope': {'From': 'string', 'Helo': 'string', 'To': ['string']},
 'Metadata': {'IngressPointId': 'string',
              'RuleSetId': 'string',
              'SenderHostname': 'string',
              'SenderIpAddress': 'string',
              'Timestamp': 'timestamp',
              'TlsCipherSuite': 'string',
              'TlsProtocol': 'string',
              'TrafficPolicyId': 'string'}}

Returns a pre-signed URL that provides temporary download access to the specific email message stored in the archive.

See also: AWS API Documentation

Request Syntax

client.get_archive_message(
    ArchivedMessageId='string'
)
type ArchivedMessageId:

string

param ArchivedMessageId:

[REQUIRED]

The unique identifier of the archived email message.

rtype:

dict

returns:

Response Syntax

{
    'Envelope': {
        'From': 'string',
        'Helo': 'string',
        'To': [
            'string',
        ]
    },
    'MessageDownloadLink': 'string',
    'Metadata': {
        'IngressPointId': 'string',
        'RuleSetId': 'string',
        'SenderHostname': 'string',
        'SenderIpAddress': 'string',
        'Timestamp': datetime(2015, 1, 1),
        'TlsCipherSuite': 'string',
        'TlsProtocol': 'string',
        'TrafficPolicyId': 'string'
    }
}

Response Structure

  • (dict) --

    The response containing details about the requested archived email message.

    • Envelope (dict) --

      The SMTP envelope information of the email.

      • From (string) --

        The RCPT FROM given by the host from which the email was received.

      • Helo (string) --

        The HELO used by the host from which the email was received.

      • To (list) --

        All SMTP TO entries given by the host from which the email was received.

        • (string) --

    • MessageDownloadLink (string) --

      A pre-signed URL to temporarily download the full message content.

    • Metadata (dict) --

      The metadata about the email.

      • IngressPointId (string) --

        The ID of the ingress endpoint through which the email was received.

      • RuleSetId (string) --

        The ID of the rule set that processed the email.

      • SenderHostname (string) --

        The name of the host from which the email was received.

      • SenderIpAddress (string) --

        The IP address of the host from which the email was received.

      • Timestamp (datetime) --

        The timestamp of when the email was received.

      • TlsCipherSuite (string) --

        The TLS cipher suite used to communicate with the host from which the email was received.

      • TlsProtocol (string) --

        The TLS protocol used to communicate with the host from which the email was received.

      • TrafficPolicyId (string) --

        The ID of the traffic policy that was in effect when the email was received.

GetArchiveSearch (updated) Link ¶
Changes (response)
{'Filters': {'Include': {'StringExpression': {'Evaluate': {'Attribute': {'ENVELOPE_FROM',
                                                                         'ENVELOPE_TO'}}}},
             'Unless': {'StringExpression': {'Evaluate': {'Attribute': {'ENVELOPE_FROM',
                                                                        'ENVELOPE_TO'}}}}}}

Retrieves the details and current status of a specific email archive search job.

See also: AWS API Documentation

Request Syntax

client.get_archive_search(
    SearchId='string'
)
type SearchId:

string

param SearchId:

[REQUIRED]

The identifier of the search job to get details for.

rtype:

dict

returns:

Response Syntax

{
    'ArchiveId': 'string',
    'Filters': {
        'Include': [
            {
                'BooleanExpression': {
                    'Evaluate': {
                        'Attribute': 'HAS_ATTACHMENTS'
                    },
                    'Operator': 'IS_TRUE'|'IS_FALSE'
                },
                'StringExpression': {
                    'Evaluate': {
                        'Attribute': 'TO'|'FROM'|'CC'|'SUBJECT'|'ENVELOPE_TO'|'ENVELOPE_FROM'
                    },
                    'Operator': 'CONTAINS',
                    'Values': [
                        'string',
                    ]
                }
            },
        ],
        'Unless': [
            {
                'BooleanExpression': {
                    'Evaluate': {
                        'Attribute': 'HAS_ATTACHMENTS'
                    },
                    'Operator': 'IS_TRUE'|'IS_FALSE'
                },
                'StringExpression': {
                    'Evaluate': {
                        'Attribute': 'TO'|'FROM'|'CC'|'SUBJECT'|'ENVELOPE_TO'|'ENVELOPE_FROM'
                    },
                    'Operator': 'CONTAINS',
                    'Values': [
                        'string',
                    ]
                }
            },
        ]
    },
    'FromTimestamp': datetime(2015, 1, 1),
    'MaxResults': 123,
    'Status': {
        'CompletionTimestamp': datetime(2015, 1, 1),
        'ErrorMessage': 'string',
        'State': 'QUEUED'|'RUNNING'|'COMPLETED'|'FAILED'|'CANCELLED',
        'SubmissionTimestamp': datetime(2015, 1, 1)
    },
    'ToTimestamp': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    The response containing details of the specified archive search job.

    • ArchiveId (string) --

      The identifier of the archive the email search was performed in.

    • Filters (dict) --

      The criteria used to filter emails included in the search.

      • Include (list) --

        The filter conditions for emails to include.

        • (dict) --

          A filter condition used to include or exclude emails when exporting from or searching an archive.

          • BooleanExpression (dict) --

            A boolean expression to evaluate against email attributes.

            • Evaluate (dict) --

              The email attribute value to evaluate.

              • Attribute (string) --

                The name of the email attribute to evaluate.

            • Operator (string) --

              The boolean operator to use for evaluation.

          • StringExpression (dict) --

            A string expression to evaluate against email attributes.

            • Evaluate (dict) --

              The attribute of the email to evaluate.

              • Attribute (string) --

                The name of the email attribute to evaluate.

            • Operator (string) --

              The operator to use when evaluating the string values.

            • Values (list) --

              The list of string values to evaluate the email attribute against.

              • (string) --

      • Unless (list) --

        The filter conditions for emails to exclude.

        • (dict) --

          A filter condition used to include or exclude emails when exporting from or searching an archive.

          • BooleanExpression (dict) --

            A boolean expression to evaluate against email attributes.

            • Evaluate (dict) --

              The email attribute value to evaluate.

              • Attribute (string) --

                The name of the email attribute to evaluate.

            • Operator (string) --

              The boolean operator to use for evaluation.

          • StringExpression (dict) --

            A string expression to evaluate against email attributes.

            • Evaluate (dict) --

              The attribute of the email to evaluate.

              • Attribute (string) --

                The name of the email attribute to evaluate.

            • Operator (string) --

              The operator to use when evaluating the string values.

            • Values (list) --

              The list of string values to evaluate the email attribute against.

              • (string) --

    • FromTimestamp (datetime) --

      The start timestamp of the range the searched emails cover.

    • MaxResults (integer) --

      The maximum number of search results to return.

    • Status (dict) --

      The current status of the search job.

      • CompletionTimestamp (datetime) --

        The timestamp of when the search completed (if finished).

      • ErrorMessage (string) --

        An error message if the search failed.

      • State (string) --

        The current state of the search job.

      • SubmissionTimestamp (datetime) --

        The timestamp of when the search was submitted.

    • ToTimestamp (datetime) --

      The end timestamp of the range the searched emails cover.

GetArchiveSearchResults (updated) Link ¶
Changes (response)
{'Rows': {'Envelope': {'From': 'string', 'Helo': 'string', 'To': ['string']},
          'IngressPointId': 'string',
          'SenderHostname': 'string',
          'SenderIpAddress': 'string'}}

Returns the results of a completed email archive search job.

See also: AWS API Documentation

Request Syntax

client.get_archive_search_results(
    SearchId='string'
)
type SearchId:

string

param SearchId:

[REQUIRED]

The identifier of the completed search job.

rtype:

dict

returns:

Response Syntax

{
    'Rows': [
        {
            'ArchivedMessageId': 'string',
            'Cc': 'string',
            'Date': 'string',
            'Envelope': {
                'From': 'string',
                'Helo': 'string',
                'To': [
                    'string',
                ]
            },
            'From': 'string',
            'HasAttachments': True|False,
            'InReplyTo': 'string',
            'IngressPointId': 'string',
            'MessageId': 'string',
            'ReceivedHeaders': [
                'string',
            ],
            'ReceivedTimestamp': datetime(2015, 1, 1),
            'SenderHostname': 'string',
            'SenderIpAddress': 'string',
            'Subject': 'string',
            'To': 'string',
            'XMailer': 'string',
            'XOriginalMailer': 'string',
            'XPriority': 'string'
        },
    ]
}

Response Structure

  • (dict) --

    The response containing search results from a completed archive search.

    • Rows (list) --

      The list of email result objects matching the search criteria.

      • (dict) --

        A result row containing metadata for an archived email message.

        • ArchivedMessageId (string) --

          The unique identifier of the archived message.

        • Cc (string) --

          The email addresses in the CC header.

        • Date (string) --

          The date the email was sent.

        • Envelope (dict) --

          The SMTP envelope information of the email.

          • From (string) --

            The RCPT FROM given by the host from which the email was received.

          • Helo (string) --

            The HELO used by the host from which the email was received.

          • To (list) --

            All SMTP TO entries given by the host from which the email was received.

            • (string) --

        • From (string) --

          The email address of the sender.

        • HasAttachments (boolean) --

          A flag indicating if the email has attachments.

        • InReplyTo (string) --

          The email message ID this is a reply to.

        • IngressPointId (string) --

          The ID of the ingress endpoint through which the email was received.

        • MessageId (string) --

          The unique message ID of the email.

        • ReceivedHeaders (list) --

          The received headers from the email delivery path.

          • (string) --

        • ReceivedTimestamp (datetime) --

          The timestamp of when the email was received.

        • SenderHostname (string) --

          The name of the host from which the email was received.

        • SenderIpAddress (string) --

          The IP address of the host from which the email was received.

        • Subject (string) --

          The subject header value of the email.

        • To (string) --

          The email addresses in the To header.

        • XMailer (string) --

          The user agent that sent the email.

        • XOriginalMailer (string) --

          The original user agent that sent the email.

        • XPriority (string) --

          The priority level of the email.

StartArchiveExport (updated) Link ¶
Changes (request)
{'Filters': {'Include': {'StringExpression': {'Evaluate': {'Attribute': {'ENVELOPE_FROM',
                                                                         'ENVELOPE_TO'}}}},
             'Unless': {'StringExpression': {'Evaluate': {'Attribute': {'ENVELOPE_FROM',
                                                                        'ENVELOPE_TO'}}}}},
 'IncludeMetadata': 'boolean'}

Initiates an export of emails from the specified archive.

See also: AWS API Documentation

Request Syntax

client.start_archive_export(
    ArchiveId='string',
    ExportDestinationConfiguration={
        'S3': {
            'S3Location': 'string'
        }
    },
    Filters={
        'Include': [
            {
                'BooleanExpression': {
                    'Evaluate': {
                        'Attribute': 'HAS_ATTACHMENTS'
                    },
                    'Operator': 'IS_TRUE'|'IS_FALSE'
                },
                'StringExpression': {
                    'Evaluate': {
                        'Attribute': 'TO'|'FROM'|'CC'|'SUBJECT'|'ENVELOPE_TO'|'ENVELOPE_FROM'
                    },
                    'Operator': 'CONTAINS',
                    'Values': [
                        'string',
                    ]
                }
            },
        ],
        'Unless': [
            {
                'BooleanExpression': {
                    'Evaluate': {
                        'Attribute': 'HAS_ATTACHMENTS'
                    },
                    'Operator': 'IS_TRUE'|'IS_FALSE'
                },
                'StringExpression': {
                    'Evaluate': {
                        'Attribute': 'TO'|'FROM'|'CC'|'SUBJECT'|'ENVELOPE_TO'|'ENVELOPE_FROM'
                    },
                    'Operator': 'CONTAINS',
                    'Values': [
                        'string',
                    ]
                }
            },
        ]
    },
    FromTimestamp=datetime(2015, 1, 1),
    IncludeMetadata=True|False,
    MaxResults=123,
    ToTimestamp=datetime(2015, 1, 1)
)
type ArchiveId:

string

param ArchiveId:

[REQUIRED]

The identifier of the archive to export emails from.

type ExportDestinationConfiguration:

dict

param ExportDestinationConfiguration:

[REQUIRED]

Details on where to deliver the exported email data.

  • S3 (dict) --

    Configuration for delivering to an Amazon S3 bucket.

    • S3Location (string) --

      The S3 location to deliver the exported email data.

type Filters:

dict

param Filters:

Criteria to filter which emails are included in the export.

  • Include (list) --

    The filter conditions for emails to include.

    • (dict) --

      A filter condition used to include or exclude emails when exporting from or searching an archive.

      • BooleanExpression (dict) --

        A boolean expression to evaluate against email attributes.

        • Evaluate (dict) -- [REQUIRED]

          The email attribute value to evaluate.

          • Attribute (string) --

            The name of the email attribute to evaluate.

        • Operator (string) -- [REQUIRED]

          The boolean operator to use for evaluation.

      • StringExpression (dict) --

        A string expression to evaluate against email attributes.

        • Evaluate (dict) -- [REQUIRED]

          The attribute of the email to evaluate.

          • Attribute (string) --

            The name of the email attribute to evaluate.

        • Operator (string) -- [REQUIRED]

          The operator to use when evaluating the string values.

        • Values (list) -- [REQUIRED]

          The list of string values to evaluate the email attribute against.

          • (string) --

  • Unless (list) --

    The filter conditions for emails to exclude.

    • (dict) --

      A filter condition used to include or exclude emails when exporting from or searching an archive.

      • BooleanExpression (dict) --

        A boolean expression to evaluate against email attributes.

        • Evaluate (dict) -- [REQUIRED]

          The email attribute value to evaluate.

          • Attribute (string) --

            The name of the email attribute to evaluate.

        • Operator (string) -- [REQUIRED]

          The boolean operator to use for evaluation.

      • StringExpression (dict) --

        A string expression to evaluate against email attributes.

        • Evaluate (dict) -- [REQUIRED]

          The attribute of the email to evaluate.

          • Attribute (string) --

            The name of the email attribute to evaluate.

        • Operator (string) -- [REQUIRED]

          The operator to use when evaluating the string values.

        • Values (list) -- [REQUIRED]

          The list of string values to evaluate the email attribute against.

          • (string) --

type FromTimestamp:

datetime

param FromTimestamp:

[REQUIRED]

The start of the timestamp range to include emails from.

type IncludeMetadata:

boolean

param IncludeMetadata:

Whether to include message metadata as JSON files in the export.

type MaxResults:

integer

param MaxResults:

The maximum number of email items to include in the export.

type ToTimestamp:

datetime

param ToTimestamp:

[REQUIRED]

The end of the timestamp range to include emails from.

rtype:

dict

returns:

Response Syntax

{
    'ExportId': 'string'
}

Response Structure

  • (dict) --

    The response from initiating an archive export.

    • ExportId (string) --

      The unique identifier for the initiated export job.

StartArchiveSearch (updated) Link ¶
Changes (request)
{'Filters': {'Include': {'StringExpression': {'Evaluate': {'Attribute': {'ENVELOPE_FROM',
                                                                         'ENVELOPE_TO'}}}},
             'Unless': {'StringExpression': {'Evaluate': {'Attribute': {'ENVELOPE_FROM',
                                                                        'ENVELOPE_TO'}}}}}}

Initiates a search across emails in the specified archive.

See also: AWS API Documentation

Request Syntax

client.start_archive_search(
    ArchiveId='string',
    Filters={
        'Include': [
            {
                'BooleanExpression': {
                    'Evaluate': {
                        'Attribute': 'HAS_ATTACHMENTS'
                    },
                    'Operator': 'IS_TRUE'|'IS_FALSE'
                },
                'StringExpression': {
                    'Evaluate': {
                        'Attribute': 'TO'|'FROM'|'CC'|'SUBJECT'|'ENVELOPE_TO'|'ENVELOPE_FROM'
                    },
                    'Operator': 'CONTAINS',
                    'Values': [
                        'string',
                    ]
                }
            },
        ],
        'Unless': [
            {
                'BooleanExpression': {
                    'Evaluate': {
                        'Attribute': 'HAS_ATTACHMENTS'
                    },
                    'Operator': 'IS_TRUE'|'IS_FALSE'
                },
                'StringExpression': {
                    'Evaluate': {
                        'Attribute': 'TO'|'FROM'|'CC'|'SUBJECT'|'ENVELOPE_TO'|'ENVELOPE_FROM'
                    },
                    'Operator': 'CONTAINS',
                    'Values': [
                        'string',
                    ]
                }
            },
        ]
    },
    FromTimestamp=datetime(2015, 1, 1),
    MaxResults=123,
    ToTimestamp=datetime(2015, 1, 1)
)
type ArchiveId:

string

param ArchiveId:

[REQUIRED]

The identifier of the archive to search emails in.

type Filters:

dict

param Filters:

Criteria to filter which emails are included in the search results.

  • Include (list) --

    The filter conditions for emails to include.

    • (dict) --

      A filter condition used to include or exclude emails when exporting from or searching an archive.

      • BooleanExpression (dict) --

        A boolean expression to evaluate against email attributes.

        • Evaluate (dict) -- [REQUIRED]

          The email attribute value to evaluate.

          • Attribute (string) --

            The name of the email attribute to evaluate.

        • Operator (string) -- [REQUIRED]

          The boolean operator to use for evaluation.

      • StringExpression (dict) --

        A string expression to evaluate against email attributes.

        • Evaluate (dict) -- [REQUIRED]

          The attribute of the email to evaluate.

          • Attribute (string) --

            The name of the email attribute to evaluate.

        • Operator (string) -- [REQUIRED]

          The operator to use when evaluating the string values.

        • Values (list) -- [REQUIRED]

          The list of string values to evaluate the email attribute against.

          • (string) --

  • Unless (list) --

    The filter conditions for emails to exclude.

    • (dict) --

      A filter condition used to include or exclude emails when exporting from or searching an archive.

      • BooleanExpression (dict) --

        A boolean expression to evaluate against email attributes.

        • Evaluate (dict) -- [REQUIRED]

          The email attribute value to evaluate.

          • Attribute (string) --

            The name of the email attribute to evaluate.

        • Operator (string) -- [REQUIRED]

          The boolean operator to use for evaluation.

      • StringExpression (dict) --

        A string expression to evaluate against email attributes.

        • Evaluate (dict) -- [REQUIRED]

          The attribute of the email to evaluate.

          • Attribute (string) --

            The name of the email attribute to evaluate.

        • Operator (string) -- [REQUIRED]

          The operator to use when evaluating the string values.

        • Values (list) -- [REQUIRED]

          The list of string values to evaluate the email attribute against.

          • (string) --

type FromTimestamp:

datetime

param FromTimestamp:

[REQUIRED]

The start timestamp of the range to search emails from.

type MaxResults:

integer

param MaxResults:

[REQUIRED]

The maximum number of search results to return.

type ToTimestamp:

datetime

param ToTimestamp:

[REQUIRED]

The end timestamp of the range to search emails from.

rtype:

dict

returns:

Response Syntax

{
    'SearchId': 'string'
}

Response Structure

  • (dict) --

    The response from initiating an archive search.

    • SearchId (string) --

      The unique identifier for the initiated search job.