SES / Client / get_identity_mail_from_domain_attributes

get_identity_mail_from_domain_attributes#

SES.Client.get_identity_mail_from_domain_attributes(**kwargs)#

Returns the custom MAIL FROM attributes for a list of identities (email addresses : domains).

This operation is throttled at one request per second and can only get custom MAIL FROM attributes for up to 100 identities at a time.

See also: AWS API Documentation

Request Syntax

response = client.get_identity_mail_from_domain_attributes(
    Identities=[
        'string',
    ]
)
Parameters:

Identities (list) –

[REQUIRED]

A list of one or more identities.

  • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'MailFromDomainAttributes': {
        'string': {
            'MailFromDomain': 'string',
            'MailFromDomainStatus': 'Pending'|'Success'|'Failed'|'TemporaryFailure',
            'BehaviorOnMXFailure': 'UseDefaultValue'|'RejectMessage'
        }
    }
}

Response Structure

  • (dict) –

    Represents the custom MAIL FROM attributes for a list of identities.

    • MailFromDomainAttributes (dict) –

      A map of identities to custom MAIL FROM attributes.

      • (string) –

        • (dict) –

          Represents the custom MAIL FROM domain attributes of a verified identity (email address or domain).

          • MailFromDomain (string) –

            The custom MAIL FROM domain that the identity is configured to use.

          • MailFromDomainStatus (string) –

            The state that indicates whether Amazon SES has successfully read the MX record required for custom MAIL FROM domain setup. If the state is Success, Amazon SES uses the specified custom MAIL FROM domain when the verified identity sends an email. All other states indicate that Amazon SES takes the action described by BehaviorOnMXFailure.

          • BehaviorOnMXFailure (string) –

            The action that Amazon SES takes if it cannot successfully read the required MX record when you send an email. A value of UseDefaultValue indicates that if Amazon SES cannot read the required MX record, it uses amazonses.com (or a subdomain of that) as the MAIL FROM domain. A value of RejectMessage indicates that if Amazon SES cannot read the required MX record, Amazon SES returns a MailFromDomainNotVerified error and does not send the email.

            The custom MAIL FROM setup states that result in this behavior are Pending, Failed, and TemporaryFailure.

Examples

The following example returns the custom MAIL FROM attributes for an identity:

response = client.get_identity_mail_from_domain_attributes(
    Identities=[
        'example.com',
    ],
)

print(response)

Expected Output:

{
    'MailFromDomainAttributes': {
        'example.com': {
            'BehaviorOnMXFailure': 'UseDefaultValue',
            'MailFromDomain': 'bounces.example.com',
            'MailFromDomainStatus': 'Success',
        },
    },
    'ResponseMetadata': {
        '...': '...',
    },
}