Amazon SES Mail Manager Code Examples
Standalone Python scripts demonstrating common Mail Manager workflows.
Each script is self-contained and runnable with pip install boto3.
| Example | What it shows |
|---|---|
| 01-setup-pipeline | Create archive + traffic policy + rule set + ingress point end-to-end |
| 02-route-by-recipient | Rule set with multiple recipient-based routing rules; safe update pattern |
| 03-archive-and-search | Async archive search, message content retrieval, S3 export |
| 04-address-list-import | Create address list, add members, bulk CSV import via pre-signed URL |
| 05-update-rule-set | Safely update ActionFailurePolicy on existing rules (fetch-modify-replace pattern) |
| 06-smtp-relay-replacement | CloudFormation: AUTH ingress point as SMTP relay replacement with Secrets Manager |
| 07-cdk-inbound-pipeline | CDK (TypeScript): OPEN ingress point with archive + S3 + send to internet |
Prerequisites
pip install boto3 requestsConfigure AWS credentials (aws configure, environment variables, or IAM role) before running.
Key Patterns Demonstrated
- Resource creation in dependency order (archive/policy/rule-set before ingress point)
- Polling for ingress point
ACTIVEstatus before updating DNS — avoids bounced email - Fetching current rules before calling
update_rule_set(replace-all semantics) - Setting
ActionFailurePolicy: CONTINUEso one failed action doesn't drop the message - Async search/export: start → poll → fetch
- Two-step address list import: create job → PUT to pre-signed URL → start job