1. Home
  2. Email
  3. Using Amazon Workmail

Removing Bulk Email Addresses from the Suppression List at the Account Level

You can manually remove addresses in bulk 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 remove from the account-level suppression list, but there is a collective delete limit of 10,000 addresses in an Amazon S3 object per API call.

To remove bulk email addresses from your account-level suppression list, follow these steps.

  • Load your address list into an Amazon S3 object in CSV or JSON format.

    CSV format example for removing addresses:

    recipient3@example.com

    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": "recipient3@example.com"}

    In the previous examples, replace recipient3@example.com with the email addresses you want to remove from the account-level suppression list.
  • 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 manually remove hunt addresses from the account-level suppression list using the AWS CLI

aws sesv2 create-import-job \
--import-destination "{\"SuppressionListDestination\": {\"SuppressionListImportAction\”:\”DELETE\"}}" \
--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 Import Requests for the Account

You can view a list of all email addresses that are on the account-level suppression list for your account by using the Import Requests List operation in 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 view a list of all import requests for the account
  • Enter the following command at the command line:
aws sesv2 list-import-jobs

The previous command returns all import jobs for the account. The output looks something like this:

{
"ImportJobs": [
{
"CreatedTimestamp": 1596175615.804,
"ImportDestination": {
"SuppressionListDestination": {
"SuppressionListImportAction": "PUT"
}
},
"JobStatus": "COMPLETED",
"JobId": "755380d7-fbdb-4ed2-a9a3-06866220f5b5"
},
{
"CreatedTimestamp": 1596134732.398,
"ImportDestination": {
"SuppressionListDestination": {
"SuppressionListImportAction": "DELETE"
}
},
"JobStatus": "COMPLETED",
"JobId": "076683bd-a7ee-4a40-9754-4ad1161ba8b6"
},
{
"CreatedTimestamp": 1596645918.134,
"ImportDestination": {
"SuppressionListDestination": {
"SuppressionListImportAction": "PUT"
}
},
"JobStatus": "COMPLETED",
"JobId": "6e261869-bd30-4b33-b1f2-9e035a83a395"
}
]
}

Retrieving information about an import job for the account

You can retrieve information about an import job for the account using the 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 about installing and configuring the AWS CLI, see AWS Command Line Interface User Guide.

To retrieve information about an import request for the account

  • Enter the following command at the command line:
aws sesv2 get-import-job --job-id JobId

The previous command returns information about an import job for the account. The output looks something like this:

Ausgabe sieht in etwa folgendermaßen aus:

{
"ImportDataSource": {
"S3Url": "s3://bucket/object",
"DataFormat": "CSV"
},
"ProcessedRecordsCount": 2,
"FailureInfo": {
"FailedRecordsS3Url": "s3presignedurl"
},
"JobStatus": "COMPLETED",
"JobId": "jobid",
"CreatedTimestamp": 1597251915.243,
"FailedRecordsCount": 1,
"ImportDestination": {
"SuppressionListDestination": {
"SuppressionListImportAction": "PUT"
}
},
"CompletedTimestamp": 1597252002.583
}