2025/01/29 - MailManager - 13 new6 updated api methods
Changes This release includes a new feature for Amazon SES Mail Manager which allows customers to specify known addresses and domains and make use of those in traffic policies and rules actions to distinguish between known and unknown entries.
Fetch attributes of a member in an address list.
See also: AWS API Documentation
Request Syntax
client.get_member_of_address_list( Address='string', AddressListId='string' )
string
[REQUIRED]
The address to be retrieved from the address list.
string
[REQUIRED]
The unique identifier of the address list to retrieve the address from.
dict
Response Syntax
{ 'Address': 'string', 'CreatedTimestamp': datetime(2015, 1, 1) }
Response Structure
(dict) --
Address (string) --
The address retrieved from the address list.
CreatedTimestamp (datetime) --
The timestamp of when the address was created.
Adds a member to an address list.
See also: AWS API Documentation
Request Syntax
client.register_member_to_address_list( Address='string', AddressListId='string' )
string
[REQUIRED]
The address to be added to the address list.
string
[REQUIRED]
The unique identifier of the address list where the address should be added.
dict
Response Syntax
{}
Response Structure
(dict) --
Deletes an address list.
See also: AWS API Documentation
Request Syntax
client.delete_address_list( AddressListId='string' )
string
[REQUIRED]
The identifier of an existing address list resource to delete.
dict
Response Syntax
{}
Response Structure
(dict) --
Lists jobs for an address list.
See also: AWS API Documentation
Request Syntax
client.list_address_list_import_jobs( AddressListId='string', NextToken='string', PageSize=123 )
string
[REQUIRED]
The unique identifier of the address list for listing import jobs.
string
If you received a pagination token from a previous call to this API, you can provide it here to continue paginating through the next page of results.
integer
The maximum number of import jobs that are returned per call. You can use NextToken to retrieve the next page of jobs.
dict
Response Syntax
{ 'ImportJobs': [ { 'AddressListId': 'string', 'CompletedTimestamp': datetime(2015, 1, 1), 'CreatedTimestamp': datetime(2015, 1, 1), 'Error': 'string', 'FailedItemsCount': 123, 'ImportDataFormat': { 'ImportDataType': 'CSV'|'JSON' }, 'ImportedItemsCount': 123, 'JobId': 'string', 'Name': 'string', 'PreSignedUrl': 'string', 'StartTimestamp': datetime(2015, 1, 1), 'Status': 'CREATED'|'PROCESSING'|'COMPLETED'|'FAILED'|'STOPPED' }, ], 'NextToken': 'string' }
Response Structure
(dict) --
ImportJobs (list) --
The list of import jobs.
(dict) --
Details about an import job.
AddressListId (string) --
The unique identifier of the address list the import job was created for.
CompletedTimestamp (datetime) --
The timestamp of when the import job was completed.
CreatedTimestamp (datetime) --
The timestamp of when the import job was created.
Error (string) --
The reason for failure of an import job.
FailedItemsCount (integer) --
The number of addresses in the input that failed to get imported into address list.
ImportDataFormat (dict) --
The format of the input for the import job.
ImportDataType (string) --
The type of file that would be passed as an input for the address list import job.
ImportedItemsCount (integer) --
The number of addresses in the input that were successfully imported into the address list.
JobId (string) --
The identifier of the import job.
Name (string) --
A user-friendly name for the import job.
PreSignedUrl (string) --
The pre-signed URL target for uploading the input file.
StartTimestamp (datetime) --
The timestamp of when the import job was started.
Status (string) --
The status of the import job.
NextToken (string) --
If NextToken is returned, there are more results available. The value of NextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page.
Lists address lists for this account.
See also: AWS API Documentation
Request Syntax
client.list_address_lists( NextToken='string', PageSize=123 )
string
If you received a pagination token from a previous call to this API, you can provide it here to continue paginating through the next page of results.
integer
The maximum number of address list resources that are returned per call. You can use NextToken to retrieve the next page of address lists.
dict
Response Syntax
{ 'AddressLists': [ { 'AddressListArn': 'string', 'AddressListId': 'string', 'AddressListName': 'string', 'CreatedTimestamp': datetime(2015, 1, 1), 'LastUpdatedTimestamp': datetime(2015, 1, 1) }, ], 'NextToken': 'string' }
Response Structure
(dict) --
AddressLists (list) --
The list of address lists.
(dict) --
An address list contains a list of emails and domains that are used in MailManager Ingress endpoints and Rules for email management.
AddressListArn (string) --
The Amazon Resource Name (ARN) of the address list.
AddressListId (string) --
The identifier of the address list.
AddressListName (string) --
The user-friendly name of the address list.
CreatedTimestamp (datetime) --
The timestamp of when the address list was created.
LastUpdatedTimestamp (datetime) --
The timestamp of when the address list was last updated.
NextToken (string) --
If NextToken is returned, there are more results available. The value of NextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page.
Creates a new address list.
See also: AWS API Documentation
Request Syntax
client.create_address_list( AddressListName='string', ClientToken='string', Tags=[ { 'Key': 'string', 'Value': 'string' }, ] )
string
[REQUIRED]
A user-friendly name for the address list.
string
A unique token that Amazon SES uses to recognize subsequent retries of the same request.
This field is autopopulated if not provided.
list
The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.
(dict) --
A key-value pair (the value is optional), that you can define and assign to Amazon Web Services resources.
Key (string) -- [REQUIRED]
The key of the key-value tag.
Value (string) -- [REQUIRED]
The value of the key-value tag.
dict
Response Syntax
{ 'AddressListId': 'string' }
Response Structure
(dict) --
AddressListId (string) --
The identifier of the created address list.
Removes a member from an address list.
See also: AWS API Documentation
Request Syntax
client.deregister_member_from_address_list( Address='string', AddressListId='string' )
string
[REQUIRED]
The address to be removed from the address list.
string
[REQUIRED]
The unique identifier of the address list to remove the address from.
dict
Response Syntax
{}
Response Structure
(dict) --
Fetch attributes of an import job.
See also: AWS API Documentation
Request Syntax
client.get_address_list_import_job( JobId='string' )
string
[REQUIRED]
The identifier of the import job that needs to be retrieved.
dict
Response Syntax
{ 'AddressListId': 'string', 'CompletedTimestamp': datetime(2015, 1, 1), 'CreatedTimestamp': datetime(2015, 1, 1), 'Error': 'string', 'FailedItemsCount': 123, 'ImportDataFormat': { 'ImportDataType': 'CSV'|'JSON' }, 'ImportedItemsCount': 123, 'JobId': 'string', 'Name': 'string', 'PreSignedUrl': 'string', 'StartTimestamp': datetime(2015, 1, 1), 'Status': 'CREATED'|'PROCESSING'|'COMPLETED'|'FAILED'|'STOPPED' }
Response Structure
(dict) --
AddressListId (string) --
The unique identifier of the address list the import job was created for.
CompletedTimestamp (datetime) --
The timestamp of when the import job was completed.
CreatedTimestamp (datetime) --
The timestamp of when the import job was created.
Error (string) --
The reason for failure of an import job.
FailedItemsCount (integer) --
The number of input addresses that failed to be imported into the address list.
ImportDataFormat (dict) --
The format of the input for an import job.
ImportDataType (string) --
The type of file that would be passed as an input for the address list import job.
ImportedItemsCount (integer) --
The number of input addresses successfully imported into the address list.
JobId (string) --
The identifier of the import job.
Name (string) --
A user-friendly name for the import job.
PreSignedUrl (string) --
The pre-signed URL target for uploading the input file.
StartTimestamp (datetime) --
The timestamp of when the import job was started.
Status (string) --
The status of the import job.
Creates an import job for an address list.
See also: AWS API Documentation
Request Syntax
client.create_address_list_import_job( AddressListId='string', ClientToken='string', ImportDataFormat={ 'ImportDataType': 'CSV'|'JSON' }, Name='string' )
string
[REQUIRED]
The unique identifier of the address list for importing addresses to.
string
A unique token that Amazon SES uses to recognize subsequent retries of the same request.
This field is autopopulated if not provided.
dict
[REQUIRED]
The format of the input for an import job.
ImportDataType (string) -- [REQUIRED]
The type of file that would be passed as an input for the address list import job.
string
[REQUIRED]
A user-friendly name for the import job.
dict
Response Syntax
{ 'JobId': 'string', 'PreSignedUrl': 'string' }
Response Structure
(dict) --
JobId (string) --
The identifier of the created import job.
PreSignedUrl (string) --
The pre-signed URL target for uploading the input file.
Stops an ongoing import job for an address list.
See also: AWS API Documentation
Request Syntax
client.stop_address_list_import_job( JobId='string' )
string
[REQUIRED]
The identifier of the import job that needs to be stopped.
dict
Response Syntax
{}
Response Structure
(dict) --
Fetch attributes of an address list.
See also: AWS API Documentation
Request Syntax
client.get_address_list( AddressListId='string' )
string
[REQUIRED]
The identifier of an existing address list resource to be retrieved.
dict
Response Syntax
{ 'AddressListArn': 'string', 'AddressListId': 'string', 'AddressListName': 'string', 'CreatedTimestamp': datetime(2015, 1, 1), 'LastUpdatedTimestamp': datetime(2015, 1, 1) }
Response Structure
(dict) --
AddressListArn (string) --
The Amazon Resource Name (ARN) of the address list resource.
AddressListId (string) --
The identifier of the address list resource.
AddressListName (string) --
A user-friendly name for the address list resource.
CreatedTimestamp (datetime) --
The date of when then address list was created.
LastUpdatedTimestamp (datetime) --
The date of when the address list was last updated.
Starts an import job for an address list.
See also: AWS API Documentation
Request Syntax
client.start_address_list_import_job( JobId='string' )
string
[REQUIRED]
The identifier of the import job that needs to be started.
dict
Response Syntax
{}
Response Structure
(dict) --
Lists members of an address list.
See also: AWS API Documentation
Request Syntax
client.list_members_of_address_list( AddressListId='string', Filter={ 'AddressPrefix': 'string' }, NextToken='string', PageSize=123 )
string
[REQUIRED]
The unique identifier of the address list to list the addresses from.
dict
Filter to be used to limit the results.
AddressPrefix (string) --
Filter to limit the results to addresses having the provided prefix.
string
If you received a pagination token from a previous call to this API, you can provide it here to continue paginating through the next page of results.
integer
The maximum number of address list members that are returned per call. You can use NextToken to retrieve the next page of members.
dict
Response Syntax
{ 'Addresses': [ { 'Address': 'string', 'CreatedTimestamp': datetime(2015, 1, 1) }, ], 'NextToken': 'string' }
Response Structure
(dict) --
Addresses (list) --
The list of addresses.
(dict) --
An address that is a member of an address list.
Address (string) --
The email or domain that constitutes the address.
CreatedTimestamp (datetime) --
The timestamp of when the address was added to the address list.
NextToken (string) --
If NextToken is returned, there are more results available. The value of NextToken is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page.
{'Rules': {'Conditions': {'BooleanExpression': {'Evaluate': {'IsInAddressList': {'AddressLists': ['string'], 'Attribute': 'RECIPIENT ' '| ' 'MAIL_FROM ' '| ' 'SENDER ' '| ' 'FROM ' '| ' 'TO ' '| ' 'CC'}}}}, 'Unless': {'BooleanExpression': {'Evaluate': {'IsInAddressList': {'AddressLists': ['string'], 'Attribute': 'RECIPIENT ' '| ' 'MAIL_FROM ' '| ' 'SENDER ' '| ' 'FROM ' '| ' 'TO ' '| ' 'CC'}}}}}}
Provision a new rule set.
See also: AWS API Documentation
Request Syntax
client.create_rule_set( ClientToken='string', RuleSetName='string', Rules=[ { 'Actions': [ { 'AddHeader': { 'HeaderName': 'string', 'HeaderValue': 'string' }, 'Archive': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'TargetArchive': 'string' }, 'DeliverToMailbox': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'MailboxArn': 'string', 'RoleArn': 'string' }, 'DeliverToQBusiness': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'ApplicationId': 'string', 'IndexId': 'string', 'RoleArn': 'string' }, 'Drop': {} , 'Relay': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'MailFrom': 'REPLACE'|'PRESERVE', 'Relay': 'string' }, 'ReplaceRecipient': { 'ReplaceWith': [ 'string', ] }, 'Send': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'RoleArn': 'string' }, 'WriteToS3': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'RoleArn': 'string', 'S3Bucket': 'string', 'S3Prefix': 'string', 'S3SseKmsKeyId': 'string' } }, ], 'Conditions': [ { 'BooleanExpression': { 'Evaluate': { 'Attribute': 'READ_RECEIPT_REQUESTED'|'TLS'|'TLS_WRAPPED', 'IsInAddressList': { 'AddressLists': [ 'string', ], 'Attribute': 'RECIPIENT'|'MAIL_FROM'|'SENDER'|'FROM'|'TO'|'CC' } }, 'Operator': 'IS_TRUE'|'IS_FALSE' }, 'DmarcExpression': { 'Operator': 'EQUALS'|'NOT_EQUALS', 'Values': [ 'NONE'|'QUARANTINE'|'REJECT', ] }, 'IpExpression': { 'Evaluate': { 'Attribute': 'SOURCE_IP' }, 'Operator': 'CIDR_MATCHES'|'NOT_CIDR_MATCHES', 'Values': [ 'string', ] }, 'NumberExpression': { 'Evaluate': { 'Attribute': 'MESSAGE_SIZE' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'LESS_THAN'|'GREATER_THAN'|'LESS_THAN_OR_EQUAL'|'GREATER_THAN_OR_EQUAL', 'Value': 123.0 }, 'StringExpression': { 'Evaluate': { 'Attribute': 'MAIL_FROM'|'HELO'|'RECIPIENT'|'SENDER'|'FROM'|'SUBJECT'|'TO'|'CC', 'MimeHeaderAttribute': 'string' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS', 'Values': [ 'string', ] }, 'VerdictExpression': { 'Evaluate': { 'Analysis': { 'Analyzer': 'string', 'ResultField': 'string' }, 'Attribute': 'SPF'|'DKIM' }, 'Operator': 'EQUALS'|'NOT_EQUALS', 'Values': [ 'PASS'|'FAIL'|'GRAY'|'PROCESSING_FAILED', ] } }, ], 'Name': 'string', 'Unless': [ { 'BooleanExpression': { 'Evaluate': { 'Attribute': 'READ_RECEIPT_REQUESTED'|'TLS'|'TLS_WRAPPED', 'IsInAddressList': { 'AddressLists': [ 'string', ], 'Attribute': 'RECIPIENT'|'MAIL_FROM'|'SENDER'|'FROM'|'TO'|'CC' } }, 'Operator': 'IS_TRUE'|'IS_FALSE' }, 'DmarcExpression': { 'Operator': 'EQUALS'|'NOT_EQUALS', 'Values': [ 'NONE'|'QUARANTINE'|'REJECT', ] }, 'IpExpression': { 'Evaluate': { 'Attribute': 'SOURCE_IP' }, 'Operator': 'CIDR_MATCHES'|'NOT_CIDR_MATCHES', 'Values': [ 'string', ] }, 'NumberExpression': { 'Evaluate': { 'Attribute': 'MESSAGE_SIZE' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'LESS_THAN'|'GREATER_THAN'|'LESS_THAN_OR_EQUAL'|'GREATER_THAN_OR_EQUAL', 'Value': 123.0 }, 'StringExpression': { 'Evaluate': { 'Attribute': 'MAIL_FROM'|'HELO'|'RECIPIENT'|'SENDER'|'FROM'|'SUBJECT'|'TO'|'CC', 'MimeHeaderAttribute': 'string' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS', 'Values': [ 'string', ] }, 'VerdictExpression': { 'Evaluate': { 'Analysis': { 'Analyzer': 'string', 'ResultField': 'string' }, 'Attribute': 'SPF'|'DKIM' }, 'Operator': 'EQUALS'|'NOT_EQUALS', 'Values': [ 'PASS'|'FAIL'|'GRAY'|'PROCESSING_FAILED', ] } }, ] }, ], Tags=[ { 'Key': 'string', 'Value': 'string' }, ] )
string
A unique token that Amazon SES uses to recognize subsequent retries of the same request.
This field is autopopulated if not provided.
string
[REQUIRED]
A user-friendly name for the rule set.
list
[REQUIRED]
Conditional rules that are evaluated for determining actions on email.
(dict) --
A rule contains conditions, "unless conditions" and actions. For each envelope recipient of an email, if all conditions match and none of the "unless conditions" match, then all of the actions are executed sequentially. If no conditions are provided, the rule always applies and the actions are implicitly executed. If only "unless conditions" are provided, the rule applies if the email does not match the evaluation of the "unless conditions".
Actions (list) -- [REQUIRED]
The list of actions to execute when the conditions match the incoming email, and none of the "unless conditions" match.
(dict) --
The action for a rule to take. Only one of the contained actions can be set.
AddHeader (dict) --
This action adds a header. This can be used to add arbitrary email headers.
HeaderName (string) -- [REQUIRED]
The name of the header to add to an email. The header must be prefixed with "X-". Headers are added regardless of whether the header name pre-existed in the email.
HeaderValue (string) -- [REQUIRED]
The value of the header to add to the email.
Archive (dict) --
This action archives the email. This can be used to deliver an email to an archive.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified archive has been deleted.
TargetArchive (string) -- [REQUIRED]
The identifier of the archive to send the email to.
DeliverToMailbox (dict) --
This action delivers an email to a WorkMail mailbox.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the mailbox ARN is no longer valid.
MailboxArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of a WorkMail organization to deliver the email to.
RoleArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of an IAM role to use to execute this action. The role must have access to the workmail:DeliverToMailbox API.
DeliverToQBusiness (dict) --
This action delivers an email to an Amazon Q Business application for ingestion into its knowledge base.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified application has been deleted or the role lacks necessary permissions to call the qbusiness:BatchPutDocument API.
ApplicationId (string) -- [REQUIRED]
The unique identifier of the Amazon Q Business application instance where the email content will be delivered.
IndexId (string) -- [REQUIRED]
The identifier of the knowledge base index within the Amazon Q Business application where the email content will be stored and indexed.
RoleArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the IAM Role to use while delivering to Amazon Q Business. This role must have access to the qbusiness:BatchPutDocument API for the given application and index.
Drop (dict) --
This action terminates the evaluation of rules in the rule set.
Relay (dict) --
This action relays the email to another SMTP server.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified relay has been deleted.
MailFrom (string) --
This action specifies whether to preserve or replace original mail from address while relaying received emails to a destination server.
Relay (string) -- [REQUIRED]
The identifier of the relay resource to be used when relaying an email.
ReplaceRecipient (dict) --
The action replaces certain or all recipients with a different set of recipients.
ReplaceWith (list) --
This action specifies the replacement recipient email addresses to insert.
(string) --
Send (dict) --
This action sends the email to the internet.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the caller does not have the permissions to call the sendRawEmail API.
RoleArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the role to use for this action. This role must have access to the ses:SendRawEmail API.
WriteToS3 (dict) --
This action writes the MIME content of the email to an S3 bucket.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified the bucket has been deleted.
RoleArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the IAM Role to use while writing to S3. This role must have access to the s3:PutObject, kms:Encrypt, and kms:GenerateDataKey APIs for the given bucket.
S3Bucket (string) -- [REQUIRED]
The bucket name of the S3 bucket to write to.
S3Prefix (string) --
The S3 prefix to use for the write to the s3 bucket.
S3SseKmsKeyId (string) --
The KMS Key ID to use to encrypt the message in S3.
Conditions (list) --
The conditions of this rule. All conditions must match the email for the actions to be executed. An empty list of conditions means that all emails match, but are still subject to any "unless conditions"
(dict) --
The conditional expression used to evaluate an email for determining if a rule action should be taken.
BooleanExpression (dict) --
The condition applies to a boolean expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The operand on which to perform a boolean condition operation.
Attribute (string) --
The boolean type representing the allowed attribute types for an email.
IsInAddressList (dict) --
The structure representing the address lists and address list attribute that will be used in evaluation of boolean expression.
AddressLists (list) -- [REQUIRED]
The address lists that will be used for evaluation.
(string) --
Attribute (string) -- [REQUIRED]
The email attribute that needs to be evaluated against the address list.
Operator (string) -- [REQUIRED]
The matching operator for a boolean condition expression.
DmarcExpression (dict) --
The condition applies to a DMARC policy expression passed in this field.
Operator (string) -- [REQUIRED]
The operator to apply to the DMARC policy of the incoming email.
Values (list) -- [REQUIRED]
The values to use for the given DMARC policy operator. For the operator EQUALS, if multiple values are given, they are evaluated as an OR. That is, if any of the given values match, the condition is deemed to match. For the operator NOT_EQUALS, if multiple values are given, they are evaluated as an AND. That is, only if the email's DMARC policy is not equal to any of the given values, then the condition is deemed to match.
(string) --
IpExpression (dict) --
The condition applies to an IP address expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The IP address to evaluate in this condition.
Attribute (string) --
The attribute of the email to evaluate.
Operator (string) -- [REQUIRED]
The operator to evaluate the IP address.
Values (list) -- [REQUIRED]
The IP CIDR blocks in format "x.y.z.w/n" (eg 10.0.0.0/8) to match with the email's IP address. For the operator CIDR_MATCHES, if multiple values are given, they are evaluated as an OR. That is, if the IP address is contained within any of the given CIDR ranges, the condition is deemed to match. For NOT_CIDR_MATCHES, if multiple CIDR ranges are given, the condition is deemed to match if the IP address is not contained in any of the given CIDR ranges.
(string) --
NumberExpression (dict) --
The condition applies to a number expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The number to evaluate in a numeric condition expression.
Attribute (string) --
An email attribute that is used as the number to evaluate.
Operator (string) -- [REQUIRED]
The operator for a numeric condition expression.
Value (float) -- [REQUIRED]
The value to evaluate in a numeric condition expression.
StringExpression (dict) --
The condition applies to a string expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The string to evaluate in a string condition expression.
Attribute (string) --
The email attribute to evaluate in a string condition expression.
MimeHeaderAttribute (string) --
The email MIME X-Header attribute to evaluate in a string condition expression.
Operator (string) -- [REQUIRED]
The matching operator for a string condition expression.
Values (list) -- [REQUIRED]
The string(s) to be evaluated in a string condition expression. For all operators, except for NOT_EQUALS, if multiple values are given, the values are processed as an OR. That is, if any of the values match the email's string using the given operator, the condition is deemed to match. However, for NOT_EQUALS, the condition is only deemed to match if none of the given strings match the email's string.
(string) --
VerdictExpression (dict) --
The condition applies to a verdict expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The verdict to evaluate in a verdict condition expression.
Analysis (dict) --
The Add On ARN and its returned value to evaluate in a verdict condition expression.
Analyzer (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of an Add On.
ResultField (string) -- [REQUIRED]
The returned value from an Add On.
Attribute (string) --
The email verdict attribute to evaluate in a string verdict expression.
Operator (string) -- [REQUIRED]
The matching operator for a verdict condition expression.
Values (list) -- [REQUIRED]
The values to match with the email's verdict using the given operator. For the EQUALS operator, if multiple values are given, the condition is deemed to match if any of the given verdicts match that of the email. For the NOT_EQUALS operator, if multiple values are given, the condition is deemed to match of none of the given verdicts match the verdict of the email.
(string) --
Name (string) --
The user-friendly name of the rule.
Unless (list) --
The "unless conditions" of this rule. None of the conditions can match the email for the actions to be executed. If any of these conditions do match the email, then the actions are not executed.
(dict) --
The conditional expression used to evaluate an email for determining if a rule action should be taken.
BooleanExpression (dict) --
The condition applies to a boolean expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The operand on which to perform a boolean condition operation.
Attribute (string) --
The boolean type representing the allowed attribute types for an email.
IsInAddressList (dict) --
The structure representing the address lists and address list attribute that will be used in evaluation of boolean expression.
AddressLists (list) -- [REQUIRED]
The address lists that will be used for evaluation.
(string) --
Attribute (string) -- [REQUIRED]
The email attribute that needs to be evaluated against the address list.
Operator (string) -- [REQUIRED]
The matching operator for a boolean condition expression.
DmarcExpression (dict) --
The condition applies to a DMARC policy expression passed in this field.
Operator (string) -- [REQUIRED]
The operator to apply to the DMARC policy of the incoming email.
Values (list) -- [REQUIRED]
The values to use for the given DMARC policy operator. For the operator EQUALS, if multiple values are given, they are evaluated as an OR. That is, if any of the given values match, the condition is deemed to match. For the operator NOT_EQUALS, if multiple values are given, they are evaluated as an AND. That is, only if the email's DMARC policy is not equal to any of the given values, then the condition is deemed to match.
(string) --
IpExpression (dict) --
The condition applies to an IP address expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The IP address to evaluate in this condition.
Attribute (string) --
The attribute of the email to evaluate.
Operator (string) -- [REQUIRED]
The operator to evaluate the IP address.
Values (list) -- [REQUIRED]
The IP CIDR blocks in format "x.y.z.w/n" (eg 10.0.0.0/8) to match with the email's IP address. For the operator CIDR_MATCHES, if multiple values are given, they are evaluated as an OR. That is, if the IP address is contained within any of the given CIDR ranges, the condition is deemed to match. For NOT_CIDR_MATCHES, if multiple CIDR ranges are given, the condition is deemed to match if the IP address is not contained in any of the given CIDR ranges.
(string) --
NumberExpression (dict) --
The condition applies to a number expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The number to evaluate in a numeric condition expression.
Attribute (string) --
An email attribute that is used as the number to evaluate.
Operator (string) -- [REQUIRED]
The operator for a numeric condition expression.
Value (float) -- [REQUIRED]
The value to evaluate in a numeric condition expression.
StringExpression (dict) --
The condition applies to a string expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The string to evaluate in a string condition expression.
Attribute (string) --
The email attribute to evaluate in a string condition expression.
MimeHeaderAttribute (string) --
The email MIME X-Header attribute to evaluate in a string condition expression.
Operator (string) -- [REQUIRED]
The matching operator for a string condition expression.
Values (list) -- [REQUIRED]
The string(s) to be evaluated in a string condition expression. For all operators, except for NOT_EQUALS, if multiple values are given, the values are processed as an OR. That is, if any of the values match the email's string using the given operator, the condition is deemed to match. However, for NOT_EQUALS, the condition is only deemed to match if none of the given strings match the email's string.
(string) --
VerdictExpression (dict) --
The condition applies to a verdict expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The verdict to evaluate in a verdict condition expression.
Analysis (dict) --
The Add On ARN and its returned value to evaluate in a verdict condition expression.
Analyzer (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of an Add On.
ResultField (string) -- [REQUIRED]
The returned value from an Add On.
Attribute (string) --
The email verdict attribute to evaluate in a string verdict expression.
Operator (string) -- [REQUIRED]
The matching operator for a verdict condition expression.
Values (list) -- [REQUIRED]
The values to match with the email's verdict using the given operator. For the EQUALS operator, if multiple values are given, the condition is deemed to match if any of the given verdicts match that of the email. For the NOT_EQUALS operator, if multiple values are given, the condition is deemed to match of none of the given verdicts match the verdict of the email.
(string) --
list
The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.
(dict) --
A key-value pair (the value is optional), that you can define and assign to Amazon Web Services resources.
Key (string) -- [REQUIRED]
The key of the key-value tag.
Value (string) -- [REQUIRED]
The value of the key-value tag.
dict
Response Syntax
{ 'RuleSetId': 'string' }
Response Structure
(dict) --
RuleSetId (string) --
The identifier of the created rule set.
{'PolicyStatements': {'Conditions': {'BooleanExpression': {'Evaluate': {'IsInAddressList': {'AddressLists': ['string'], 'Attribute': 'RECIPIENT'}}}}}}
Provision a new traffic policy resource.
See also: AWS API Documentation
Request Syntax
client.create_traffic_policy( ClientToken='string', DefaultAction='ALLOW'|'DENY', MaxMessageSizeBytes=123, PolicyStatements=[ { 'Action': 'ALLOW'|'DENY', 'Conditions': [ { 'BooleanExpression': { 'Evaluate': { 'Analysis': { 'Analyzer': 'string', 'ResultField': 'string' }, 'IsInAddressList': { 'AddressLists': [ 'string', ], 'Attribute': 'RECIPIENT' } }, 'Operator': 'IS_TRUE'|'IS_FALSE' }, 'IpExpression': { 'Evaluate': { 'Attribute': 'SENDER_IP' }, 'Operator': 'CIDR_MATCHES'|'NOT_CIDR_MATCHES', 'Values': [ 'string', ] }, 'StringExpression': { 'Evaluate': { 'Attribute': 'RECIPIENT' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS', 'Values': [ 'string', ] }, 'TlsExpression': { 'Evaluate': { 'Attribute': 'TLS_PROTOCOL' }, 'Operator': 'MINIMUM_TLS_VERSION'|'IS', 'Value': 'TLS1_2'|'TLS1_3' } }, ] }, ], Tags=[ { 'Key': 'string', 'Value': 'string' }, ], TrafficPolicyName='string' )
string
A unique token that Amazon SES uses to recognize subsequent retries of the same request.
This field is autopopulated if not provided.
string
[REQUIRED]
Default action instructs the traffic policy to either Allow or Deny (block) messages that fall outside of (or not addressed by) the conditions of your policy statements
integer
The maximum message size in bytes of email which is allowed in by this traffic policy—anything larger will be blocked.
list
[REQUIRED]
Conditional statements for filtering email traffic.
(dict) --
The structure containing traffic policy conditions and actions.
Action (string) -- [REQUIRED]
The action that informs a traffic policy resource to either allow or block the email if it matches a condition in the policy statement.
Conditions (list) -- [REQUIRED]
The list of conditions to apply to incoming messages for filtering email traffic.
(dict) --
The email traffic filtering conditions which are contained in a traffic policy resource.
BooleanExpression (dict) --
This represents a boolean type condition matching on the incoming mail. It performs the boolean operation configured in 'Operator' and evaluates the 'Protocol' object against the 'Value'.
Evaluate (dict) -- [REQUIRED]
The operand on which to perform a boolean condition operation.
Analysis (dict) --
The structure type for a boolean condition stating the Add On ARN and its returned value.
Analyzer (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of an Add On.
ResultField (string) -- [REQUIRED]
The returned value from an Add On.
IsInAddressList (dict) --
The structure type for a boolean condition that provides the address lists to evaluate incoming traffic on.
AddressLists (list) -- [REQUIRED]
The address lists that will be used for evaluation.
(string) --
Attribute (string) -- [REQUIRED]
The email attribute that needs to be evaluated against the address list.
Operator (string) -- [REQUIRED]
The matching operator for a boolean condition expression.
IpExpression (dict) --
This represents an IP based condition matching on the incoming mail. It performs the operation configured in 'Operator' and evaluates the 'Protocol' object against the 'Value'.
Evaluate (dict) -- [REQUIRED]
The left hand side argument of an IP condition expression.
Attribute (string) --
An enum type representing the allowed attribute types for an IP condition.
Operator (string) -- [REQUIRED]
The matching operator for an IP condition expression.
Values (list) -- [REQUIRED]
The right hand side argument of an IP condition expression.
(string) --
StringExpression (dict) --
This represents a string based condition matching on the incoming mail. It performs the string operation configured in 'Operator' and evaluates the 'Protocol' object against the 'Value'.
Evaluate (dict) -- [REQUIRED]
The left hand side argument of a string condition expression.
Attribute (string) --
The enum type representing the allowed attribute types for a string condition.
Operator (string) -- [REQUIRED]
The matching operator for a string condition expression.
Values (list) -- [REQUIRED]
The right hand side argument of a string condition expression.
(string) --
TlsExpression (dict) --
This represents a TLS based condition matching on the incoming mail. It performs the operation configured in 'Operator' and evaluates the 'Protocol' object against the 'Value'.
Evaluate (dict) -- [REQUIRED]
The left hand side argument of a TLS condition expression.
Attribute (string) --
The enum type representing the allowed attribute types for the TLS condition.
Operator (string) -- [REQUIRED]
The matching operator for a TLS condition expression.
Value (string) -- [REQUIRED]
The right hand side argument of a TLS condition expression.
list
The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.
(dict) --
A key-value pair (the value is optional), that you can define and assign to Amazon Web Services resources.
Key (string) -- [REQUIRED]
The key of the key-value tag.
Value (string) -- [REQUIRED]
The value of the key-value tag.
string
[REQUIRED]
A user-friendly name for the traffic policy resource.
dict
Response Syntax
{ 'TrafficPolicyId': 'string' }
Response Structure
(dict) --
TrafficPolicyId (string) --
The identifier of the traffic policy resource.
{'Rules': {'Conditions': {'BooleanExpression': {'Evaluate': {'IsInAddressList': {'AddressLists': ['string'], 'Attribute': 'RECIPIENT ' '| ' 'MAIL_FROM ' '| ' 'SENDER ' '| ' 'FROM ' '| ' 'TO ' '| ' 'CC'}}}}, 'Unless': {'BooleanExpression': {'Evaluate': {'IsInAddressList': {'AddressLists': ['string'], 'Attribute': 'RECIPIENT ' '| ' 'MAIL_FROM ' '| ' 'SENDER ' '| ' 'FROM ' '| ' 'TO ' '| ' 'CC'}}}}}}
Fetch attributes of a rule set.
See also: AWS API Documentation
Request Syntax
client.get_rule_set( RuleSetId='string' )
string
[REQUIRED]
The identifier of an existing rule set to be retrieved.
dict
Response Syntax
{ 'CreatedDate': datetime(2015, 1, 1), 'LastModificationDate': datetime(2015, 1, 1), 'RuleSetArn': 'string', 'RuleSetId': 'string', 'RuleSetName': 'string', 'Rules': [ { 'Actions': [ { 'AddHeader': { 'HeaderName': 'string', 'HeaderValue': 'string' }, 'Archive': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'TargetArchive': 'string' }, 'DeliverToMailbox': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'MailboxArn': 'string', 'RoleArn': 'string' }, 'DeliverToQBusiness': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'ApplicationId': 'string', 'IndexId': 'string', 'RoleArn': 'string' }, 'Drop': {}, 'Relay': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'MailFrom': 'REPLACE'|'PRESERVE', 'Relay': 'string' }, 'ReplaceRecipient': { 'ReplaceWith': [ 'string', ] }, 'Send': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'RoleArn': 'string' }, 'WriteToS3': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'RoleArn': 'string', 'S3Bucket': 'string', 'S3Prefix': 'string', 'S3SseKmsKeyId': 'string' } }, ], 'Conditions': [ { 'BooleanExpression': { 'Evaluate': { 'Attribute': 'READ_RECEIPT_REQUESTED'|'TLS'|'TLS_WRAPPED', 'IsInAddressList': { 'AddressLists': [ 'string', ], 'Attribute': 'RECIPIENT'|'MAIL_FROM'|'SENDER'|'FROM'|'TO'|'CC' } }, 'Operator': 'IS_TRUE'|'IS_FALSE' }, 'DmarcExpression': { 'Operator': 'EQUALS'|'NOT_EQUALS', 'Values': [ 'NONE'|'QUARANTINE'|'REJECT', ] }, 'IpExpression': { 'Evaluate': { 'Attribute': 'SOURCE_IP' }, 'Operator': 'CIDR_MATCHES'|'NOT_CIDR_MATCHES', 'Values': [ 'string', ] }, 'NumberExpression': { 'Evaluate': { 'Attribute': 'MESSAGE_SIZE' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'LESS_THAN'|'GREATER_THAN'|'LESS_THAN_OR_EQUAL'|'GREATER_THAN_OR_EQUAL', 'Value': 123.0 }, 'StringExpression': { 'Evaluate': { 'Attribute': 'MAIL_FROM'|'HELO'|'RECIPIENT'|'SENDER'|'FROM'|'SUBJECT'|'TO'|'CC', 'MimeHeaderAttribute': 'string' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS', 'Values': [ 'string', ] }, 'VerdictExpression': { 'Evaluate': { 'Analysis': { 'Analyzer': 'string', 'ResultField': 'string' }, 'Attribute': 'SPF'|'DKIM' }, 'Operator': 'EQUALS'|'NOT_EQUALS', 'Values': [ 'PASS'|'FAIL'|'GRAY'|'PROCESSING_FAILED', ] } }, ], 'Name': 'string', 'Unless': [ { 'BooleanExpression': { 'Evaluate': { 'Attribute': 'READ_RECEIPT_REQUESTED'|'TLS'|'TLS_WRAPPED', 'IsInAddressList': { 'AddressLists': [ 'string', ], 'Attribute': 'RECIPIENT'|'MAIL_FROM'|'SENDER'|'FROM'|'TO'|'CC' } }, 'Operator': 'IS_TRUE'|'IS_FALSE' }, 'DmarcExpression': { 'Operator': 'EQUALS'|'NOT_EQUALS', 'Values': [ 'NONE'|'QUARANTINE'|'REJECT', ] }, 'IpExpression': { 'Evaluate': { 'Attribute': 'SOURCE_IP' }, 'Operator': 'CIDR_MATCHES'|'NOT_CIDR_MATCHES', 'Values': [ 'string', ] }, 'NumberExpression': { 'Evaluate': { 'Attribute': 'MESSAGE_SIZE' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'LESS_THAN'|'GREATER_THAN'|'LESS_THAN_OR_EQUAL'|'GREATER_THAN_OR_EQUAL', 'Value': 123.0 }, 'StringExpression': { 'Evaluate': { 'Attribute': 'MAIL_FROM'|'HELO'|'RECIPIENT'|'SENDER'|'FROM'|'SUBJECT'|'TO'|'CC', 'MimeHeaderAttribute': 'string' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS', 'Values': [ 'string', ] }, 'VerdictExpression': { 'Evaluate': { 'Analysis': { 'Analyzer': 'string', 'ResultField': 'string' }, 'Attribute': 'SPF'|'DKIM' }, 'Operator': 'EQUALS'|'NOT_EQUALS', 'Values': [ 'PASS'|'FAIL'|'GRAY'|'PROCESSING_FAILED', ] } }, ] }, ] }
Response Structure
(dict) --
CreatedDate (datetime) --
The date of when then rule set was created.
LastModificationDate (datetime) --
The date of when the rule set was last modified.
RuleSetArn (string) --
The Amazon Resource Name (ARN) of the rule set resource.
RuleSetId (string) --
The identifier of the rule set resource.
RuleSetName (string) --
A user-friendly name for the rule set resource.
Rules (list) --
The rules contained in the rule set.
(dict) --
A rule contains conditions, "unless conditions" and actions. For each envelope recipient of an email, if all conditions match and none of the "unless conditions" match, then all of the actions are executed sequentially. If no conditions are provided, the rule always applies and the actions are implicitly executed. If only "unless conditions" are provided, the rule applies if the email does not match the evaluation of the "unless conditions".
Actions (list) --
The list of actions to execute when the conditions match the incoming email, and none of the "unless conditions" match.
(dict) --
The action for a rule to take. Only one of the contained actions can be set.
AddHeader (dict) --
This action adds a header. This can be used to add arbitrary email headers.
HeaderName (string) --
The name of the header to add to an email. The header must be prefixed with "X-". Headers are added regardless of whether the header name pre-existed in the email.
HeaderValue (string) --
The value of the header to add to the email.
Archive (dict) --
This action archives the email. This can be used to deliver an email to an archive.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified archive has been deleted.
TargetArchive (string) --
The identifier of the archive to send the email to.
DeliverToMailbox (dict) --
This action delivers an email to a WorkMail mailbox.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the mailbox ARN is no longer valid.
MailboxArn (string) --
The Amazon Resource Name (ARN) of a WorkMail organization to deliver the email to.
RoleArn (string) --
The Amazon Resource Name (ARN) of an IAM role to use to execute this action. The role must have access to the workmail:DeliverToMailbox API.
DeliverToQBusiness (dict) --
This action delivers an email to an Amazon Q Business application for ingestion into its knowledge base.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified application has been deleted or the role lacks necessary permissions to call the qbusiness:BatchPutDocument API.
ApplicationId (string) --
The unique identifier of the Amazon Q Business application instance where the email content will be delivered.
IndexId (string) --
The identifier of the knowledge base index within the Amazon Q Business application where the email content will be stored and indexed.
RoleArn (string) --
The Amazon Resource Name (ARN) of the IAM Role to use while delivering to Amazon Q Business. This role must have access to the qbusiness:BatchPutDocument API for the given application and index.
Drop (dict) --
This action terminates the evaluation of rules in the rule set.
Relay (dict) --
This action relays the email to another SMTP server.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified relay has been deleted.
MailFrom (string) --
This action specifies whether to preserve or replace original mail from address while relaying received emails to a destination server.
Relay (string) --
The identifier of the relay resource to be used when relaying an email.
ReplaceRecipient (dict) --
The action replaces certain or all recipients with a different set of recipients.
ReplaceWith (list) --
This action specifies the replacement recipient email addresses to insert.
(string) --
Send (dict) --
This action sends the email to the internet.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the caller does not have the permissions to call the sendRawEmail API.
RoleArn (string) --
The Amazon Resource Name (ARN) of the role to use for this action. This role must have access to the ses:SendRawEmail API.
WriteToS3 (dict) --
This action writes the MIME content of the email to an S3 bucket.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified the bucket has been deleted.
RoleArn (string) --
The Amazon Resource Name (ARN) of the IAM Role to use while writing to S3. This role must have access to the s3:PutObject, kms:Encrypt, and kms:GenerateDataKey APIs for the given bucket.
S3Bucket (string) --
The bucket name of the S3 bucket to write to.
S3Prefix (string) --
The S3 prefix to use for the write to the s3 bucket.
S3SseKmsKeyId (string) --
The KMS Key ID to use to encrypt the message in S3.
Conditions (list) --
The conditions of this rule. All conditions must match the email for the actions to be executed. An empty list of conditions means that all emails match, but are still subject to any "unless conditions"
(dict) --
The conditional expression used to evaluate an email for determining if a rule action should be taken.
BooleanExpression (dict) --
The condition applies to a boolean expression passed in this field.
Evaluate (dict) --
The operand on which to perform a boolean condition operation.
Attribute (string) --
The boolean type representing the allowed attribute types for an email.
IsInAddressList (dict) --
The structure representing the address lists and address list attribute that will be used in evaluation of boolean expression.
AddressLists (list) --
The address lists that will be used for evaluation.
(string) --
Attribute (string) --
The email attribute that needs to be evaluated against the address list.
Operator (string) --
The matching operator for a boolean condition expression.
DmarcExpression (dict) --
The condition applies to a DMARC policy expression passed in this field.
Operator (string) --
The operator to apply to the DMARC policy of the incoming email.
Values (list) --
The values to use for the given DMARC policy operator. For the operator EQUALS, if multiple values are given, they are evaluated as an OR. That is, if any of the given values match, the condition is deemed to match. For the operator NOT_EQUALS, if multiple values are given, they are evaluated as an AND. That is, only if the email's DMARC policy is not equal to any of the given values, then the condition is deemed to match.
(string) --
IpExpression (dict) --
The condition applies to an IP address expression passed in this field.
Evaluate (dict) --
The IP address to evaluate in this condition.
Attribute (string) --
The attribute of the email to evaluate.
Operator (string) --
The operator to evaluate the IP address.
Values (list) --
The IP CIDR blocks in format "x.y.z.w/n" (eg 10.0.0.0/8) to match with the email's IP address. For the operator CIDR_MATCHES, if multiple values are given, they are evaluated as an OR. That is, if the IP address is contained within any of the given CIDR ranges, the condition is deemed to match. For NOT_CIDR_MATCHES, if multiple CIDR ranges are given, the condition is deemed to match if the IP address is not contained in any of the given CIDR ranges.
(string) --
NumberExpression (dict) --
The condition applies to a number expression passed in this field.
Evaluate (dict) --
The number to evaluate in a numeric condition expression.
Attribute (string) --
An email attribute that is used as the number to evaluate.
Operator (string) --
The operator for a numeric condition expression.
Value (float) --
The value to evaluate in a numeric condition expression.
StringExpression (dict) --
The condition applies to a string expression passed in this field.
Evaluate (dict) --
The string to evaluate in a string condition expression.
Attribute (string) --
The email attribute to evaluate in a string condition expression.
MimeHeaderAttribute (string) --
The email MIME X-Header attribute to evaluate in a string condition expression.
Operator (string) --
The matching operator for a string condition expression.
Values (list) --
The string(s) to be evaluated in a string condition expression. For all operators, except for NOT_EQUALS, if multiple values are given, the values are processed as an OR. That is, if any of the values match the email's string using the given operator, the condition is deemed to match. However, for NOT_EQUALS, the condition is only deemed to match if none of the given strings match the email's string.
(string) --
VerdictExpression (dict) --
The condition applies to a verdict expression passed in this field.
Evaluate (dict) --
The verdict to evaluate in a verdict condition expression.
Analysis (dict) --
The Add On ARN and its returned value to evaluate in a verdict condition expression.
Analyzer (string) --
The Amazon Resource Name (ARN) of an Add On.
ResultField (string) --
The returned value from an Add On.
Attribute (string) --
The email verdict attribute to evaluate in a string verdict expression.
Operator (string) --
The matching operator for a verdict condition expression.
Values (list) --
The values to match with the email's verdict using the given operator. For the EQUALS operator, if multiple values are given, the condition is deemed to match if any of the given verdicts match that of the email. For the NOT_EQUALS operator, if multiple values are given, the condition is deemed to match of none of the given verdicts match the verdict of the email.
(string) --
Name (string) --
The user-friendly name of the rule.
Unless (list) --
The "unless conditions" of this rule. None of the conditions can match the email for the actions to be executed. If any of these conditions do match the email, then the actions are not executed.
(dict) --
The conditional expression used to evaluate an email for determining if a rule action should be taken.
BooleanExpression (dict) --
The condition applies to a boolean expression passed in this field.
Evaluate (dict) --
The operand on which to perform a boolean condition operation.
Attribute (string) --
The boolean type representing the allowed attribute types for an email.
IsInAddressList (dict) --
The structure representing the address lists and address list attribute that will be used in evaluation of boolean expression.
AddressLists (list) --
The address lists that will be used for evaluation.
(string) --
Attribute (string) --
The email attribute that needs to be evaluated against the address list.
Operator (string) --
The matching operator for a boolean condition expression.
DmarcExpression (dict) --
The condition applies to a DMARC policy expression passed in this field.
Operator (string) --
The operator to apply to the DMARC policy of the incoming email.
Values (list) --
The values to use for the given DMARC policy operator. For the operator EQUALS, if multiple values are given, they are evaluated as an OR. That is, if any of the given values match, the condition is deemed to match. For the operator NOT_EQUALS, if multiple values are given, they are evaluated as an AND. That is, only if the email's DMARC policy is not equal to any of the given values, then the condition is deemed to match.
(string) --
IpExpression (dict) --
The condition applies to an IP address expression passed in this field.
Evaluate (dict) --
The IP address to evaluate in this condition.
Attribute (string) --
The attribute of the email to evaluate.
Operator (string) --
The operator to evaluate the IP address.
Values (list) --
The IP CIDR blocks in format "x.y.z.w/n" (eg 10.0.0.0/8) to match with the email's IP address. For the operator CIDR_MATCHES, if multiple values are given, they are evaluated as an OR. That is, if the IP address is contained within any of the given CIDR ranges, the condition is deemed to match. For NOT_CIDR_MATCHES, if multiple CIDR ranges are given, the condition is deemed to match if the IP address is not contained in any of the given CIDR ranges.
(string) --
NumberExpression (dict) --
The condition applies to a number expression passed in this field.
Evaluate (dict) --
The number to evaluate in a numeric condition expression.
Attribute (string) --
An email attribute that is used as the number to evaluate.
Operator (string) --
The operator for a numeric condition expression.
Value (float) --
The value to evaluate in a numeric condition expression.
StringExpression (dict) --
The condition applies to a string expression passed in this field.
Evaluate (dict) --
The string to evaluate in a string condition expression.
Attribute (string) --
The email attribute to evaluate in a string condition expression.
MimeHeaderAttribute (string) --
The email MIME X-Header attribute to evaluate in a string condition expression.
Operator (string) --
The matching operator for a string condition expression.
Values (list) --
The string(s) to be evaluated in a string condition expression. For all operators, except for NOT_EQUALS, if multiple values are given, the values are processed as an OR. That is, if any of the values match the email's string using the given operator, the condition is deemed to match. However, for NOT_EQUALS, the condition is only deemed to match if none of the given strings match the email's string.
(string) --
VerdictExpression (dict) --
The condition applies to a verdict expression passed in this field.
Evaluate (dict) --
The verdict to evaluate in a verdict condition expression.
Analysis (dict) --
The Add On ARN and its returned value to evaluate in a verdict condition expression.
Analyzer (string) --
The Amazon Resource Name (ARN) of an Add On.
ResultField (string) --
The returned value from an Add On.
Attribute (string) --
The email verdict attribute to evaluate in a string verdict expression.
Operator (string) --
The matching operator for a verdict condition expression.
Values (list) --
The values to match with the email's verdict using the given operator. For the EQUALS operator, if multiple values are given, the condition is deemed to match if any of the given verdicts match that of the email. For the NOT_EQUALS operator, if multiple values are given, the condition is deemed to match of none of the given verdicts match the verdict of the email.
(string) --
{'PolicyStatements': {'Conditions': {'BooleanExpression': {'Evaluate': {'IsInAddressList': {'AddressLists': ['string'], 'Attribute': 'RECIPIENT'}}}}}}
Fetch attributes of a traffic policy resource.
See also: AWS API Documentation
Request Syntax
client.get_traffic_policy( TrafficPolicyId='string' )
string
[REQUIRED]
The identifier of the traffic policy resource.
dict
Response Syntax
{ 'CreatedTimestamp': datetime(2015, 1, 1), 'DefaultAction': 'ALLOW'|'DENY', 'LastUpdatedTimestamp': datetime(2015, 1, 1), 'MaxMessageSizeBytes': 123, 'PolicyStatements': [ { 'Action': 'ALLOW'|'DENY', 'Conditions': [ { 'BooleanExpression': { 'Evaluate': { 'Analysis': { 'Analyzer': 'string', 'ResultField': 'string' }, 'IsInAddressList': { 'AddressLists': [ 'string', ], 'Attribute': 'RECIPIENT' } }, 'Operator': 'IS_TRUE'|'IS_FALSE' }, 'IpExpression': { 'Evaluate': { 'Attribute': 'SENDER_IP' }, 'Operator': 'CIDR_MATCHES'|'NOT_CIDR_MATCHES', 'Values': [ 'string', ] }, 'StringExpression': { 'Evaluate': { 'Attribute': 'RECIPIENT' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS', 'Values': [ 'string', ] }, 'TlsExpression': { 'Evaluate': { 'Attribute': 'TLS_PROTOCOL' }, 'Operator': 'MINIMUM_TLS_VERSION'|'IS', 'Value': 'TLS1_2'|'TLS1_3' } }, ] }, ], 'TrafficPolicyArn': 'string', 'TrafficPolicyId': 'string', 'TrafficPolicyName': 'string' }
Response Structure
(dict) --
CreatedTimestamp (datetime) --
The timestamp of when the traffic policy was created.
DefaultAction (string) --
The default action of the traffic policy.
LastUpdatedTimestamp (datetime) --
The timestamp of when the traffic policy was last updated.
MaxMessageSizeBytes (integer) --
The maximum message size in bytes of email which is allowed in by this traffic policy—anything larger will be blocked.
PolicyStatements (list) --
The list of conditions which are in the traffic policy resource.
(dict) --
The structure containing traffic policy conditions and actions.
Action (string) --
The action that informs a traffic policy resource to either allow or block the email if it matches a condition in the policy statement.
Conditions (list) --
The list of conditions to apply to incoming messages for filtering email traffic.
(dict) --
The email traffic filtering conditions which are contained in a traffic policy resource.
BooleanExpression (dict) --
This represents a boolean type condition matching on the incoming mail. It performs the boolean operation configured in 'Operator' and evaluates the 'Protocol' object against the 'Value'.
Evaluate (dict) --
The operand on which to perform a boolean condition operation.
Analysis (dict) --
The structure type for a boolean condition stating the Add On ARN and its returned value.
Analyzer (string) --
The Amazon Resource Name (ARN) of an Add On.
ResultField (string) --
The returned value from an Add On.
IsInAddressList (dict) --
The structure type for a boolean condition that provides the address lists to evaluate incoming traffic on.
AddressLists (list) --
The address lists that will be used for evaluation.
(string) --
Attribute (string) --
The email attribute that needs to be evaluated against the address list.
Operator (string) --
The matching operator for a boolean condition expression.
IpExpression (dict) --
This represents an IP based condition matching on the incoming mail. It performs the operation configured in 'Operator' and evaluates the 'Protocol' object against the 'Value'.
Evaluate (dict) --
The left hand side argument of an IP condition expression.
Attribute (string) --
An enum type representing the allowed attribute types for an IP condition.
Operator (string) --
The matching operator for an IP condition expression.
Values (list) --
The right hand side argument of an IP condition expression.
(string) --
StringExpression (dict) --
This represents a string based condition matching on the incoming mail. It performs the string operation configured in 'Operator' and evaluates the 'Protocol' object against the 'Value'.
Evaluate (dict) --
The left hand side argument of a string condition expression.
Attribute (string) --
The enum type representing the allowed attribute types for a string condition.
Operator (string) --
The matching operator for a string condition expression.
Values (list) --
The right hand side argument of a string condition expression.
(string) --
TlsExpression (dict) --
This represents a TLS based condition matching on the incoming mail. It performs the operation configured in 'Operator' and evaluates the 'Protocol' object against the 'Value'.
Evaluate (dict) --
The left hand side argument of a TLS condition expression.
Attribute (string) --
The enum type representing the allowed attribute types for the TLS condition.
Operator (string) --
The matching operator for a TLS condition expression.
Value (string) --
The right hand side argument of a TLS condition expression.
TrafficPolicyArn (string) --
The Amazon Resource Name (ARN) of the traffic policy resource.
TrafficPolicyId (string) --
The identifier of the traffic policy resource.
TrafficPolicyName (string) --
A user-friendly name for the traffic policy resource.
{'Rules': {'Conditions': {'BooleanExpression': {'Evaluate': {'IsInAddressList': {'AddressLists': ['string'], 'Attribute': 'RECIPIENT ' '| ' 'MAIL_FROM ' '| ' 'SENDER ' '| ' 'FROM ' '| ' 'TO ' '| ' 'CC'}}}}, 'Unless': {'BooleanExpression': {'Evaluate': {'IsInAddressList': {'AddressLists': ['string'], 'Attribute': 'RECIPIENT ' '| ' 'MAIL_FROM ' '| ' 'SENDER ' '| ' 'FROM ' '| ' 'TO ' '| ' 'CC'}}}}}}
Update attributes of an already provisioned rule set.
See also: AWS API Documentation
Request Syntax
client.update_rule_set( RuleSetId='string', RuleSetName='string', Rules=[ { 'Actions': [ { 'AddHeader': { 'HeaderName': 'string', 'HeaderValue': 'string' }, 'Archive': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'TargetArchive': 'string' }, 'DeliverToMailbox': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'MailboxArn': 'string', 'RoleArn': 'string' }, 'DeliverToQBusiness': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'ApplicationId': 'string', 'IndexId': 'string', 'RoleArn': 'string' }, 'Drop': {} , 'Relay': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'MailFrom': 'REPLACE'|'PRESERVE', 'Relay': 'string' }, 'ReplaceRecipient': { 'ReplaceWith': [ 'string', ] }, 'Send': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'RoleArn': 'string' }, 'WriteToS3': { 'ActionFailurePolicy': 'CONTINUE'|'DROP', 'RoleArn': 'string', 'S3Bucket': 'string', 'S3Prefix': 'string', 'S3SseKmsKeyId': 'string' } }, ], 'Conditions': [ { 'BooleanExpression': { 'Evaluate': { 'Attribute': 'READ_RECEIPT_REQUESTED'|'TLS'|'TLS_WRAPPED', 'IsInAddressList': { 'AddressLists': [ 'string', ], 'Attribute': 'RECIPIENT'|'MAIL_FROM'|'SENDER'|'FROM'|'TO'|'CC' } }, 'Operator': 'IS_TRUE'|'IS_FALSE' }, 'DmarcExpression': { 'Operator': 'EQUALS'|'NOT_EQUALS', 'Values': [ 'NONE'|'QUARANTINE'|'REJECT', ] }, 'IpExpression': { 'Evaluate': { 'Attribute': 'SOURCE_IP' }, 'Operator': 'CIDR_MATCHES'|'NOT_CIDR_MATCHES', 'Values': [ 'string', ] }, 'NumberExpression': { 'Evaluate': { 'Attribute': 'MESSAGE_SIZE' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'LESS_THAN'|'GREATER_THAN'|'LESS_THAN_OR_EQUAL'|'GREATER_THAN_OR_EQUAL', 'Value': 123.0 }, 'StringExpression': { 'Evaluate': { 'Attribute': 'MAIL_FROM'|'HELO'|'RECIPIENT'|'SENDER'|'FROM'|'SUBJECT'|'TO'|'CC', 'MimeHeaderAttribute': 'string' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS', 'Values': [ 'string', ] }, 'VerdictExpression': { 'Evaluate': { 'Analysis': { 'Analyzer': 'string', 'ResultField': 'string' }, 'Attribute': 'SPF'|'DKIM' }, 'Operator': 'EQUALS'|'NOT_EQUALS', 'Values': [ 'PASS'|'FAIL'|'GRAY'|'PROCESSING_FAILED', ] } }, ], 'Name': 'string', 'Unless': [ { 'BooleanExpression': { 'Evaluate': { 'Attribute': 'READ_RECEIPT_REQUESTED'|'TLS'|'TLS_WRAPPED', 'IsInAddressList': { 'AddressLists': [ 'string', ], 'Attribute': 'RECIPIENT'|'MAIL_FROM'|'SENDER'|'FROM'|'TO'|'CC' } }, 'Operator': 'IS_TRUE'|'IS_FALSE' }, 'DmarcExpression': { 'Operator': 'EQUALS'|'NOT_EQUALS', 'Values': [ 'NONE'|'QUARANTINE'|'REJECT', ] }, 'IpExpression': { 'Evaluate': { 'Attribute': 'SOURCE_IP' }, 'Operator': 'CIDR_MATCHES'|'NOT_CIDR_MATCHES', 'Values': [ 'string', ] }, 'NumberExpression': { 'Evaluate': { 'Attribute': 'MESSAGE_SIZE' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'LESS_THAN'|'GREATER_THAN'|'LESS_THAN_OR_EQUAL'|'GREATER_THAN_OR_EQUAL', 'Value': 123.0 }, 'StringExpression': { 'Evaluate': { 'Attribute': 'MAIL_FROM'|'HELO'|'RECIPIENT'|'SENDER'|'FROM'|'SUBJECT'|'TO'|'CC', 'MimeHeaderAttribute': 'string' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS', 'Values': [ 'string', ] }, 'VerdictExpression': { 'Evaluate': { 'Analysis': { 'Analyzer': 'string', 'ResultField': 'string' }, 'Attribute': 'SPF'|'DKIM' }, 'Operator': 'EQUALS'|'NOT_EQUALS', 'Values': [ 'PASS'|'FAIL'|'GRAY'|'PROCESSING_FAILED', ] } }, ] }, ] )
string
[REQUIRED]
The identifier of a rule set you want to update.
string
A user-friendly name for the rule set resource.
list
A new set of rules to replace the current rules of the rule set—these rules will override all the rules of the rule set.
(dict) --
A rule contains conditions, "unless conditions" and actions. For each envelope recipient of an email, if all conditions match and none of the "unless conditions" match, then all of the actions are executed sequentially. If no conditions are provided, the rule always applies and the actions are implicitly executed. If only "unless conditions" are provided, the rule applies if the email does not match the evaluation of the "unless conditions".
Actions (list) -- [REQUIRED]
The list of actions to execute when the conditions match the incoming email, and none of the "unless conditions" match.
(dict) --
The action for a rule to take. Only one of the contained actions can be set.
AddHeader (dict) --
This action adds a header. This can be used to add arbitrary email headers.
HeaderName (string) -- [REQUIRED]
The name of the header to add to an email. The header must be prefixed with "X-". Headers are added regardless of whether the header name pre-existed in the email.
HeaderValue (string) -- [REQUIRED]
The value of the header to add to the email.
Archive (dict) --
This action archives the email. This can be used to deliver an email to an archive.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified archive has been deleted.
TargetArchive (string) -- [REQUIRED]
The identifier of the archive to send the email to.
DeliverToMailbox (dict) --
This action delivers an email to a WorkMail mailbox.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the mailbox ARN is no longer valid.
MailboxArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of a WorkMail organization to deliver the email to.
RoleArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of an IAM role to use to execute this action. The role must have access to the workmail:DeliverToMailbox API.
DeliverToQBusiness (dict) --
This action delivers an email to an Amazon Q Business application for ingestion into its knowledge base.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified application has been deleted or the role lacks necessary permissions to call the qbusiness:BatchPutDocument API.
ApplicationId (string) -- [REQUIRED]
The unique identifier of the Amazon Q Business application instance where the email content will be delivered.
IndexId (string) -- [REQUIRED]
The identifier of the knowledge base index within the Amazon Q Business application where the email content will be stored and indexed.
RoleArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the IAM Role to use while delivering to Amazon Q Business. This role must have access to the qbusiness:BatchPutDocument API for the given application and index.
Drop (dict) --
This action terminates the evaluation of rules in the rule set.
Relay (dict) --
This action relays the email to another SMTP server.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified relay has been deleted.
MailFrom (string) --
This action specifies whether to preserve or replace original mail from address while relaying received emails to a destination server.
Relay (string) -- [REQUIRED]
The identifier of the relay resource to be used when relaying an email.
ReplaceRecipient (dict) --
The action replaces certain or all recipients with a different set of recipients.
ReplaceWith (list) --
This action specifies the replacement recipient email addresses to insert.
(string) --
Send (dict) --
This action sends the email to the internet.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the caller does not have the permissions to call the sendRawEmail API.
RoleArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the role to use for this action. This role must have access to the ses:SendRawEmail API.
WriteToS3 (dict) --
This action writes the MIME content of the email to an S3 bucket.
ActionFailurePolicy (string) --
A policy that states what to do in the case of failure. The action will fail if there are configuration errors. For example, the specified the bucket has been deleted.
RoleArn (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of the IAM Role to use while writing to S3. This role must have access to the s3:PutObject, kms:Encrypt, and kms:GenerateDataKey APIs for the given bucket.
S3Bucket (string) -- [REQUIRED]
The bucket name of the S3 bucket to write to.
S3Prefix (string) --
The S3 prefix to use for the write to the s3 bucket.
S3SseKmsKeyId (string) --
The KMS Key ID to use to encrypt the message in S3.
Conditions (list) --
The conditions of this rule. All conditions must match the email for the actions to be executed. An empty list of conditions means that all emails match, but are still subject to any "unless conditions"
(dict) --
The conditional expression used to evaluate an email for determining if a rule action should be taken.
BooleanExpression (dict) --
The condition applies to a boolean expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The operand on which to perform a boolean condition operation.
Attribute (string) --
The boolean type representing the allowed attribute types for an email.
IsInAddressList (dict) --
The structure representing the address lists and address list attribute that will be used in evaluation of boolean expression.
AddressLists (list) -- [REQUIRED]
The address lists that will be used for evaluation.
(string) --
Attribute (string) -- [REQUIRED]
The email attribute that needs to be evaluated against the address list.
Operator (string) -- [REQUIRED]
The matching operator for a boolean condition expression.
DmarcExpression (dict) --
The condition applies to a DMARC policy expression passed in this field.
Operator (string) -- [REQUIRED]
The operator to apply to the DMARC policy of the incoming email.
Values (list) -- [REQUIRED]
The values to use for the given DMARC policy operator. For the operator EQUALS, if multiple values are given, they are evaluated as an OR. That is, if any of the given values match, the condition is deemed to match. For the operator NOT_EQUALS, if multiple values are given, they are evaluated as an AND. That is, only if the email's DMARC policy is not equal to any of the given values, then the condition is deemed to match.
(string) --
IpExpression (dict) --
The condition applies to an IP address expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The IP address to evaluate in this condition.
Attribute (string) --
The attribute of the email to evaluate.
Operator (string) -- [REQUIRED]
The operator to evaluate the IP address.
Values (list) -- [REQUIRED]
The IP CIDR blocks in format "x.y.z.w/n" (eg 10.0.0.0/8) to match with the email's IP address. For the operator CIDR_MATCHES, if multiple values are given, they are evaluated as an OR. That is, if the IP address is contained within any of the given CIDR ranges, the condition is deemed to match. For NOT_CIDR_MATCHES, if multiple CIDR ranges are given, the condition is deemed to match if the IP address is not contained in any of the given CIDR ranges.
(string) --
NumberExpression (dict) --
The condition applies to a number expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The number to evaluate in a numeric condition expression.
Attribute (string) --
An email attribute that is used as the number to evaluate.
Operator (string) -- [REQUIRED]
The operator for a numeric condition expression.
Value (float) -- [REQUIRED]
The value to evaluate in a numeric condition expression.
StringExpression (dict) --
The condition applies to a string expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The string to evaluate in a string condition expression.
Attribute (string) --
The email attribute to evaluate in a string condition expression.
MimeHeaderAttribute (string) --
The email MIME X-Header attribute to evaluate in a string condition expression.
Operator (string) -- [REQUIRED]
The matching operator for a string condition expression.
Values (list) -- [REQUIRED]
The string(s) to be evaluated in a string condition expression. For all operators, except for NOT_EQUALS, if multiple values are given, the values are processed as an OR. That is, if any of the values match the email's string using the given operator, the condition is deemed to match. However, for NOT_EQUALS, the condition is only deemed to match if none of the given strings match the email's string.
(string) --
VerdictExpression (dict) --
The condition applies to a verdict expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The verdict to evaluate in a verdict condition expression.
Analysis (dict) --
The Add On ARN and its returned value to evaluate in a verdict condition expression.
Analyzer (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of an Add On.
ResultField (string) -- [REQUIRED]
The returned value from an Add On.
Attribute (string) --
The email verdict attribute to evaluate in a string verdict expression.
Operator (string) -- [REQUIRED]
The matching operator for a verdict condition expression.
Values (list) -- [REQUIRED]
The values to match with the email's verdict using the given operator. For the EQUALS operator, if multiple values are given, the condition is deemed to match if any of the given verdicts match that of the email. For the NOT_EQUALS operator, if multiple values are given, the condition is deemed to match of none of the given verdicts match the verdict of the email.
(string) --
Name (string) --
The user-friendly name of the rule.
Unless (list) --
The "unless conditions" of this rule. None of the conditions can match the email for the actions to be executed. If any of these conditions do match the email, then the actions are not executed.
(dict) --
The conditional expression used to evaluate an email for determining if a rule action should be taken.
BooleanExpression (dict) --
The condition applies to a boolean expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The operand on which to perform a boolean condition operation.
Attribute (string) --
The boolean type representing the allowed attribute types for an email.
IsInAddressList (dict) --
The structure representing the address lists and address list attribute that will be used in evaluation of boolean expression.
AddressLists (list) -- [REQUIRED]
The address lists that will be used for evaluation.
(string) --
Attribute (string) -- [REQUIRED]
The email attribute that needs to be evaluated against the address list.
Operator (string) -- [REQUIRED]
The matching operator for a boolean condition expression.
DmarcExpression (dict) --
The condition applies to a DMARC policy expression passed in this field.
Operator (string) -- [REQUIRED]
The operator to apply to the DMARC policy of the incoming email.
Values (list) -- [REQUIRED]
The values to use for the given DMARC policy operator. For the operator EQUALS, if multiple values are given, they are evaluated as an OR. That is, if any of the given values match, the condition is deemed to match. For the operator NOT_EQUALS, if multiple values are given, they are evaluated as an AND. That is, only if the email's DMARC policy is not equal to any of the given values, then the condition is deemed to match.
(string) --
IpExpression (dict) --
The condition applies to an IP address expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The IP address to evaluate in this condition.
Attribute (string) --
The attribute of the email to evaluate.
Operator (string) -- [REQUIRED]
The operator to evaluate the IP address.
Values (list) -- [REQUIRED]
The IP CIDR blocks in format "x.y.z.w/n" (eg 10.0.0.0/8) to match with the email's IP address. For the operator CIDR_MATCHES, if multiple values are given, they are evaluated as an OR. That is, if the IP address is contained within any of the given CIDR ranges, the condition is deemed to match. For NOT_CIDR_MATCHES, if multiple CIDR ranges are given, the condition is deemed to match if the IP address is not contained in any of the given CIDR ranges.
(string) --
NumberExpression (dict) --
The condition applies to a number expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The number to evaluate in a numeric condition expression.
Attribute (string) --
An email attribute that is used as the number to evaluate.
Operator (string) -- [REQUIRED]
The operator for a numeric condition expression.
Value (float) -- [REQUIRED]
The value to evaluate in a numeric condition expression.
StringExpression (dict) --
The condition applies to a string expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The string to evaluate in a string condition expression.
Attribute (string) --
The email attribute to evaluate in a string condition expression.
MimeHeaderAttribute (string) --
The email MIME X-Header attribute to evaluate in a string condition expression.
Operator (string) -- [REQUIRED]
The matching operator for a string condition expression.
Values (list) -- [REQUIRED]
The string(s) to be evaluated in a string condition expression. For all operators, except for NOT_EQUALS, if multiple values are given, the values are processed as an OR. That is, if any of the values match the email's string using the given operator, the condition is deemed to match. However, for NOT_EQUALS, the condition is only deemed to match if none of the given strings match the email's string.
(string) --
VerdictExpression (dict) --
The condition applies to a verdict expression passed in this field.
Evaluate (dict) -- [REQUIRED]
The verdict to evaluate in a verdict condition expression.
Analysis (dict) --
The Add On ARN and its returned value to evaluate in a verdict condition expression.
Analyzer (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of an Add On.
ResultField (string) -- [REQUIRED]
The returned value from an Add On.
Attribute (string) --
The email verdict attribute to evaluate in a string verdict expression.
Operator (string) -- [REQUIRED]
The matching operator for a verdict condition expression.
Values (list) -- [REQUIRED]
The values to match with the email's verdict using the given operator. For the EQUALS operator, if multiple values are given, the condition is deemed to match if any of the given verdicts match that of the email. For the NOT_EQUALS operator, if multiple values are given, the condition is deemed to match of none of the given verdicts match the verdict of the email.
(string) --
dict
Response Syntax
{}
Response Structure
(dict) --
{'PolicyStatements': {'Conditions': {'BooleanExpression': {'Evaluate': {'IsInAddressList': {'AddressLists': ['string'], 'Attribute': 'RECIPIENT'}}}}}}
Update attributes of an already provisioned traffic policy resource.
See also: AWS API Documentation
Request Syntax
client.update_traffic_policy( DefaultAction='ALLOW'|'DENY', MaxMessageSizeBytes=123, PolicyStatements=[ { 'Action': 'ALLOW'|'DENY', 'Conditions': [ { 'BooleanExpression': { 'Evaluate': { 'Analysis': { 'Analyzer': 'string', 'ResultField': 'string' }, 'IsInAddressList': { 'AddressLists': [ 'string', ], 'Attribute': 'RECIPIENT' } }, 'Operator': 'IS_TRUE'|'IS_FALSE' }, 'IpExpression': { 'Evaluate': { 'Attribute': 'SENDER_IP' }, 'Operator': 'CIDR_MATCHES'|'NOT_CIDR_MATCHES', 'Values': [ 'string', ] }, 'StringExpression': { 'Evaluate': { 'Attribute': 'RECIPIENT' }, 'Operator': 'EQUALS'|'NOT_EQUALS'|'STARTS_WITH'|'ENDS_WITH'|'CONTAINS', 'Values': [ 'string', ] }, 'TlsExpression': { 'Evaluate': { 'Attribute': 'TLS_PROTOCOL' }, 'Operator': 'MINIMUM_TLS_VERSION'|'IS', 'Value': 'TLS1_2'|'TLS1_3' } }, ] }, ], TrafficPolicyId='string', TrafficPolicyName='string' )
string
Default action instructs the traffic policy to either Allow or Deny (block) messages that fall outside of (or not addressed by) the conditions of your policy statements
integer
The maximum message size in bytes of email which is allowed in by this traffic policy—anything larger will be blocked.
list
The list of conditions to be updated for filtering email traffic.
(dict) --
The structure containing traffic policy conditions and actions.
Action (string) -- [REQUIRED]
The action that informs a traffic policy resource to either allow or block the email if it matches a condition in the policy statement.
Conditions (list) -- [REQUIRED]
The list of conditions to apply to incoming messages for filtering email traffic.
(dict) --
The email traffic filtering conditions which are contained in a traffic policy resource.
BooleanExpression (dict) --
This represents a boolean type condition matching on the incoming mail. It performs the boolean operation configured in 'Operator' and evaluates the 'Protocol' object against the 'Value'.
Evaluate (dict) -- [REQUIRED]
The operand on which to perform a boolean condition operation.
Analysis (dict) --
The structure type for a boolean condition stating the Add On ARN and its returned value.
Analyzer (string) -- [REQUIRED]
The Amazon Resource Name (ARN) of an Add On.
ResultField (string) -- [REQUIRED]
The returned value from an Add On.
IsInAddressList (dict) --
The structure type for a boolean condition that provides the address lists to evaluate incoming traffic on.
AddressLists (list) -- [REQUIRED]
The address lists that will be used for evaluation.
(string) --
Attribute (string) -- [REQUIRED]
The email attribute that needs to be evaluated against the address list.
Operator (string) -- [REQUIRED]
The matching operator for a boolean condition expression.
IpExpression (dict) --
This represents an IP based condition matching on the incoming mail. It performs the operation configured in 'Operator' and evaluates the 'Protocol' object against the 'Value'.
Evaluate (dict) -- [REQUIRED]
The left hand side argument of an IP condition expression.
Attribute (string) --
An enum type representing the allowed attribute types for an IP condition.
Operator (string) -- [REQUIRED]
The matching operator for an IP condition expression.
Values (list) -- [REQUIRED]
The right hand side argument of an IP condition expression.
(string) --
StringExpression (dict) --
This represents a string based condition matching on the incoming mail. It performs the string operation configured in 'Operator' and evaluates the 'Protocol' object against the 'Value'.
Evaluate (dict) -- [REQUIRED]
The left hand side argument of a string condition expression.
Attribute (string) --
The enum type representing the allowed attribute types for a string condition.
Operator (string) -- [REQUIRED]
The matching operator for a string condition expression.
Values (list) -- [REQUIRED]
The right hand side argument of a string condition expression.
(string) --
TlsExpression (dict) --
This represents a TLS based condition matching on the incoming mail. It performs the operation configured in 'Operator' and evaluates the 'Protocol' object against the 'Value'.
Evaluate (dict) -- [REQUIRED]
The left hand side argument of a TLS condition expression.
Attribute (string) --
The enum type representing the allowed attribute types for the TLS condition.
Operator (string) -- [REQUIRED]
The matching operator for a TLS condition expression.
Value (string) -- [REQUIRED]
The right hand side argument of a TLS condition expression.
string
[REQUIRED]
The identifier of the traffic policy that you want to update.
string
A user-friendly name for the traffic policy resource.
dict
Response Syntax
{}
Response Structure
(dict) --