Index of every page on this site: llms.txt
All skills
amazon-ses avatar

/aws-mail-manager

@58f234e
Run it yourself

Process, route, filter, and archive inbound email with Amazon SES Mail Manager. Use when building email ingress pipelines, spam/IP filtering, compliance archiving, SMTP relay forwarding, address allow/block lists, or any inbound email processing workflow. Covers ingress points, traffic policies, rule sets, relays, archives, and address lists.

Use this Skill: https://skilld.dev/gh/amazon-ses/skills/aws-mail-manager

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesaddress-listsaddress-list-guide.md

≈1.6k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Amazon SES Mail Manager Address List Guide

Address lists are managed collections of email addresses or domains used in rule set conditions for allow/block list matching. They support individual address management and bulk import via CSV or JSON.

Note: The email addresses and domains in this guide (such as spammer@example.com, @example.net) are fictitious examples for illustration purposes only.

Prerequisites

  • boto3 installed: pip install boto3
  • For bulk import: pip install requests
  • AWS credentials configured: aws configure
  • Amazon SES Mail Manager enabled in your account/region

Key Facts

  • Address lists are standalone resources — no dependencies on other Mail Manager resources
  • Used in rule set conditions via BooleanExpression with IsInAddressList — checks if a message attribute (SENDER, RECIPIENT, etc.) matches any entry in the list
  • Bulk import requires a two-step process: create job (get pre-signed URL) → upload data → start job
  • Import jobs are async — poll get_address_list_import_job for completion

Create an Address List

import boto3

client = boto3.client('mailmanager', region_name='us-east-1')

response = client.create_address_list(
    AddressListName='blocked-senders'
)
address_list_id = response['AddressListId']
print(f"Address List ID: {address_list_id}")

Add Individual Addresses

# Add a single address
client.register_member_to_address_list(
    AddressListId=address_list_id,
    Address='spammer@example.com'
)

# Add a domain (matches any address at that domain)
client.register_member_to_address_list(
    AddressListId=address_list_id,
    Address='@example.net'
)

Remove an Address

client.deregister_member_from_address_list(
    AddressListId=address_list_id,
    Address='spammer@example.com'
)

List Members

# List all members
members = client.list_members_of_address_list(AddressListId=address_list_id)
for m in members['Members']:
    print(m['Address'], m['CreatedTimestamp'])

# Filter by prefix
filtered = client.list_members_of_address_list(
    AddressListId=address_list_id,
    Filter={'AddressFilter': {'AddressPrefix': '@example'}}
)

Check if an Address is a Member

try:
    member = client.get_member_of_address_list(
        AddressListId=address_list_id,
        Address='spammer@example.com'
    )
    print("Address is in the list:", member['Address'])
except client.exceptions.ResourceNotFoundException:
    print("Address not in list")

Bulk Import

Import large address lists via CSV or JSON. The process is: create job → upload to pre-signed URL → start job → poll for completion.

CSV format

One address per line:

spammer@example.com
@example.net
phishing@example.org

JSON format

["spammer@example.com", "@example.net", "phishing@example.org"]

Import workflow

import requests  # pip install requests

# 1. Create the import job — get a pre-signed upload URL
job = client.create_address_list_import_job(
    AddressListId=address_list_id,
    Name='bulk-deny-list-import-2024-01',
    ImportDataFormat={'ImportDataType': 'CSV'}  # or 'JSON'
)
job_id = job['JobId']
presigned_url = job['PreSignedUrl']

# 2. Upload your data to the pre-signed URL
with open('deny-list.csv', 'rb') as f:
    upload_response = requests.put(presigned_url, data=f)
    upload_response.raise_for_status()

# 3. Start the import job
client.start_address_list_import_job(JobId=job_id)

# 4. Poll until complete
import time
while True:
    status = client.get_address_list_import_job(JobId=job_id)
    state = status['Status']
    print(f"Import status: {state}")
    if state in ('COMPLETED', 'FAILED', 'STOPPED'):
        break
    time.sleep(5)

if state == 'COMPLETED':
    print(f"Imported {status['ImportedItemsCount']} addresses")
else:
    print(f"Import failed: {status.get('FailureInfo')}")

List Import Jobs

jobs = client.list_address_list_import_jobs(AddressListId=address_list_id)
for job in jobs['ImportJobs']:
    print(job['JobId'], job['Status'], job.get('ImportedItemsCount'))

Stop an In-Progress Import

client.stop_address_list_import_job(JobId=job_id)

Using Address Lists in Rule Conditions

Address lists are checked using BooleanExpression with IsInAddressList. This evaluates whether an email attribute (sender, recipient, etc.) matches any entry in the address list:

# In a rule set condition — check if SENDER is in a specific address list
{
    'BooleanExpression': {
        'Evaluate': {
            'IsInAddressList': {
                'AddressLists': [address_list_id],  # exactly one address list
                'Attribute': 'SENDER'  # RECIPIENT, MAIL_FROM, SENDER, FROM, TO, or CC
            }
        },
        'Operator': 'IS_TRUE'  # or IS_FALSE to negate
    }
}

A practical pattern — block senders on your deny list:

client.create_rule_set(
    RuleSetName='deny-list-enforcement',
    Rules=[
        {
            'Name': 'blocked-senders',
            'Conditions': [
                {
                    'BooleanExpression': {
                        'Evaluate': {
                            'IsInAddressList': {
                                'AddressLists': [blocked_senders_list_id],
                                'Attribute': 'SENDER'
                            }
                        },
                        'Operator': 'IS_TRUE'
                    }
                }
            ],
            'Actions': [{'Drop': {}}]
        }
    ]
)

List and Get

# List all address lists
lists = client.list_address_lists()
for al in lists['AddressLists']:
    print(al['AddressListId'], al['AddressListName'])

# Get details
address_list = client.get_address_list(AddressListId=address_list_id)
print(address_list['AddressListName'])
print(address_list['CreatedTimestamp'])

Delete

Before deleting an address list, remove it from any rule set conditions and traffic policy statements that reference it. Deleting an address list that is still referenced will cause those conditions to fail.

# Note: remove the address list from any rule conditions before deleting
client.delete_address_list(AddressListId=address_list_id)

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts5mo3 checks · Risk SAFE
  • Gen Agent Trust Hub5mo

    This skill provides comprehensive documentation and code examples for managing Amazon SES Mail Manager. It enables AI agents to assist in setting up email ingress pipelines, traffic policies, rule sets, and archiving workflows using official AWS SDKs and infrastructure-as-code tools. No malicious patterns or security vulnerabilities were detected.

  • Socket5mo

    No alerts

  • Snyk5mo

    Risk: LOW · No issues

Signed by skilld at 58f234e. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 6 months ago
Other metadata
compatibility
Requires AWS credentials (IAM user, role, or environment variables) and an AWS account with Amazon SES Mail Manager enabled. Python SDK — boto3 with client name 'mailmanager'. Available in all commercial AWS regions where SES is offered (27 regions as of December 2025). See https://aws.amazon.com/about-aws/whats-new/2025/12/ses-mail-manager-10-regions/ for the latest availability.
metadata
{
  "author": "aws",
  "version": "1.0",
  "service": "mailmanager",
  "revision": 1,
  "updated-on": "2026-03-20",
  "source": "maintainer",
  "tags": "ses,mail-manager,email,smtp,ingress,archive,relay,traffic-policy,rule-set"
}

README badge

README badge for amazon-ses/skills/aws-mail-manager