1. Home
  2. Email
  3. Using Amazon Workmail

Manually add individual email addresses to the account level suppression list

You can manually add individual addresses to the account-level suppression list.

You can do this by using the PutSuppressedDestination operation in the Amazon SES API v2. There is no limit to the number of addresses you can add to the account-level suppression list.



Note
The following procedure assumes that you have already installed the AWS CLI. For more information on installing and configuring the AWS CLI, see AWS Command Line Interface User Guide.

To manually add an address to the suppression list at the account level using the AWS CLI

  • aws sesv2 put-suppressed-destination \
    --email-address recipient@example.com \
    --reason BOUNCE

    In the previous example, replace recipient@example.com with the email address you want to add to the account-level suppression list and BOUNCE with the reason you are adding the address to the suppression list (acceptable values are BOUNCE and COMPLAINT).



Adding Bulk E-mail Addresses to the Suppression List at Account Level

You can add addresses in bulk manually by first importing your contact list into an Amazon S3 object followed by using the Create Import Job operation in the Amazon SES API v2.


Note
There is no limit to the number of addresses you can add to the account-level suppression list, but there is a bulk add a limit of 100,000 addresses in an Amazon S3 object per API call.

Follow these steps to add bulk email addresses to your account-level suppression list.

  • Load your address list into an Amazon S3 object in CSV or JSON format.
    CSV format example for adding addresses:

    recipient1@example.com,BOUNCE

    recipient2@example.com, COMPLAINT

    Only JSON files with newline separation are supported. In this format, each line is a complete JSON object containing a single address definition.

    JSON format example for adding addresses:

    {"emailAddress": "recipient1@example.com", "reason": "BOUNCE"}

    {"emailAddress": "recipient2@example.com", "reason": "COMPLAINT"}

    In the previous examples, replace recipient1@example.com and recipient2@example.com with the email addresses you want to add to the account-level suppression list. The acceptable reasons for adding the addresses to the suppression list are BOUNCE and COMPLAINT.
  • Give Amazon SES permission to read the Amazon S3 object.
    When applied to an Amazon S3 bucket, the following policy gives Amazon SES permission to read that bucket. For more information about attaching policies to Amazon S3 buckets, see Using Bucket Policies and User Policies in the Amazon Simple Storage Service Developer Guide.
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AllowSESGet",
"Effect": "Allow",
"Principal": {
"Service": "ses.amazonaws.com"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::BUCKET-NAME/OBJECT-NAME",
"Condition": {
"StringEquals": {
"aws:Referer": "AWSACCOUNTID"
}
}
}
]
}
  • Give Amazon SES permission to use your AWS KMS master key.
    If the Amazon S3 The object is encrypted with an AWS KMS key. You must give Amazon SES permission to use the AWS KMS key. Amazon SES can only get permission from a custom master key, not a default master key. You must grant Amazon SES permission to use the custom master key by adding a policy statement to the key's policy.

  • Add the following policy statement to the key's policy to allow Amazon SES to use your custom master key.
  • {
    "Sid": "AllowSESToDecrypt",
    "Effect": "Allow",
    "Principal": {
    "Service":"ses.amazonaws.com"
    },
    "Action": [
    "kms:Decrypt",
    ],
    "Resource": "*"
    }
  • Use the Create Import Job operation in the Amazon SES API v2.

 
Note
The following procedure assumes that you have already installed the AWS CLI. For more information on installing and configuring the AWS CLI, see AWS Command Line Interface User Guide.

To add collective addresses to the suppression list at the account level using the manually AWS CLI

aws sesv2 create-import-job \
--import-destination "{\"SuppressionListDestination\": {\"SuppressionListImportAction\”:\”PUT\"}}" \
--import-data-source "{\"S3Url\": \"s3://s3bucket/s3object\",\"DataFormat\": \"CSV\"}"
In the previous examples, replace s3bucket and s3object with the Amazon S3 bucket name and Amazon S3 object name.


Viewing a list of addresses that are on the account-level suppression list

You can display a list of all email addresses that are on the account-level suppression list in your account by using the ListSuppressedDestinations operation in the Amazon SES API v2.


Note
The following procedure assumes that you have already installed the AWS CLI. For more information about installing and configuring the AWS CLI, see AWS Command Line Interface User Guide.

View a list of all email addresses that are in the account-level suppression list.

  • Enter the following command at the command line:
    aws sesv2 list-suppressed-destinations

The above command will return all email addresses that are in the account level suppression list in your account. The output will look something like this:
{
"SuppressedDestinationSummaries": [
{
"EmailAddress": "recipient2@example.com",
"Reason": "COMPLAINT",
"LastUpdateTime": 1586552585.077
},
{
"EmailAddress": "recipient0@example.com",
"Reason": "COMPLAINT",
"LastUpdateTime": 1586552666.613
},
{
"EmailAddress": "recipient1@example.com",
"Reason": "BOUNCE",
"LastUpdateTime": 1586556479.141
}
]
}
You can use the StartDate option to display only email addresses added to the list after a specific date.

To view a list of addresses added to the suppression list at the account level after a specific date

  • Enter the following command at the command line:
    aws sesv2 list-suppressed-destinations --start-date 1604394130

 


In the previous command, replace 1604394130 with the Unix timestamp of the start date.

You can also use the EndDate option to display only email addresses added to the list before a certain date.

To view a list of addresses added to the suppression list at the account level before a specific date

  • Enter the following command at the command line:
    aws sesv2 list-suppressed-destinations --end-date 1611126000
In the previous command, replace 1611126000 with the Unix timestamp of the end date.

You can also use the built-in grep utility in the Linux, macOS, or Unix command line to search for specific addresses or domains.

To search for a specific address in the suppression list at the account level

  • Enter the following command at the command line:
aws sesv2 list-suppressed-destinations | grep -A2 'example.com'
In the previous command, replace example.com with the text string (e.g. address or domain) you want to search for.



Removing an email address from the account-level suppression list

If an address is added to the suppression list for your account, but you know that the address does not belong on the list, you can manually remove it using the DeleteSuppressedDestination operation in the Amazon SES- API v2.


Note
The following procedure assumes that you have already installed the AWS CLI. For more information about installing and configuring the AWS CLI, see AWS Command Line Interface User Guide.



To use the AWS CLI to remove an address from the suppression list at the account level

  • aws sesv2 delete-suppressed-destination \
    --email-address recipient@example.com

    In the previous example, replace recipient@example.com with the email address you want to remove from the account-level suppression list.