# Amazon SES

Amazon Simple Email Service (SES) is one of the routes by which Connect sends email. Connect calls the SES v2 API through `boto3`, by default in the Mumbai region, and records SES's message ID as evidence that the message was accepted. JBRH Mail's sending identities and its event notifications also live in SES. Delivery, bounces and complaints come back as events. On the production host, JBRH Mail's Stalwart relays outbound mail through SMTP2GO, not SES: SES carries a message only for an identity configured to use it.

- **Status:** Reference
- **Audience:** both, developer
- **Last verified:** 2026-11-02
- **Canonical:** https://connectbyjbrh.com/docs/technology/amazon-ses/

## What it is

Amazon SES is AWS's email-sending service, launched in 2011. A sender verifies a domain or address as an identity, publishes DKIM records, and sends through an API or SMTP. Configuration sets route events such as deliveries, bounces and complaints to notification targets.

`boto3` is the AWS SDK for Python. Connect uses its `sesv2` client for sending, `s3` for media and files, and `secretsmanager` where a credential is read from a secret store.

**Category** — Email sending service
**Client** — `boto3>=1.35`, `sesv2` client
**Default region** — `ap-south-1` (the provider setting can change it)
**Official site** — [aws.amazon.com/ses](https://aws.amazon.com/ses/)

## Where Connect uses it

| Place in Connect | What it does there |
|---|---|
| `backend/app/providers.py` | The SES send path: build the MIME message, call SES, keep the message ID |
| `backend/app/safe_sales.py` | Sales sends that go through SES |
| JBRH Mail | Sending identities, the configuration set and its notification topic |
| `email_delivery_webhooks.py` | Delivery, bounce and complaint events, verified before use |

## How it connects

1. A message passes Connect's send boundary (autonomy, allowance, suppression)
2. The MIME message is built with the business's From and DKIM-aligned domain
3. `sesv2.send_email` returns a message ID: accepted, not yet delivered
4. Delivery, bounce or complaint events arrive later
5. Bounces and complaints feed the suppression list

## Benefits and limits

What it gives Connect:

- High deliverability infrastructure at a low per-message price.
- Events give the evidence a business needs: accepted, delivered, bounced, complained.
- Region choice keeps sending in India alongside the rest of the stack.

Where it stops, and what Connect does about it:

- New accounts start in the SES sandbox with sending limits until AWS approves production access.
- Accepted is not delivered. Connect never reports a send as delivered on SES's acceptance alone.
- Reputation is per account and domain. Sustained bounces or complaints can pause sending.

## Security and privacy

- Domains are authenticated with SPF, DKIM and DMARC ([DMARC](/docs/technology/dmarc/)).
- On the host, AWS access comes from the instance role, not stored keys.
- Suppression and one-click unsubscribe are honoured before SES is ever called.

## Licence, cost and versions

| Question | Answer |
|---|---|
| Licence | SES: commercial service. boto3: Apache-2.0 |
| Cost | Per message and data, per the [SES pricing page](https://aws.amazon.com/ses/pricing/) |
| Version | SES API v2; `boto3>=1.35` |
| Compatibility | Any region where SES is offered; identities are per region |

## Troubleshooting

**`MessageRejected: Email address is not verified`** — The account or region is still in the SES sandbox, or the From identity is not verified in that region.
**Mail sent but not received** — Check the event stream for a bounce or complaint, and the recipient's spam folder. See [deliverability](/docs/technology/deliverability/).
**Throttling errors** — The account's send rate was exceeded. The queue paces and retries.

## Official references

- [Amazon SES developer guide](https://docs.aws.amazon.com/ses/latest/dg/)
- [SES API v2 reference](https://docs.aws.amazon.com/ses/latest/APIReference-V2/)
- [boto3 SESV2](https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/sesv2.html)

## Questions

### Does every Connect email go through SES?

No. A connected Gmail or Microsoft mailbox sends through its own provider, and JBRH Mail mailboxes through Stalwart. SES is the route for the identities configured to use it.

### Why does Connect say 'accepted' rather than 'delivered'?

Because SES returning a message ID means it took the message. Delivery is a later event, and Connect records it only when the event arrives.

## Related

- [SMTP](https://connectbyjbrh.com/docs/technology/smtp/)
- [DKIM](https://connectbyjbrh.com/docs/technology/dkim/)
- [Bounces](https://connectbyjbrh.com/docs/technology/bounce/)
- [Stalwart mail server](https://connectbyjbrh.com/docs/technology/stalwart/)
- [Amazon Web Services hosting](https://connectbyjbrh.com/docs/technology/aws-hosting/)

## What this page is based on

- `backend/app/providers.py`
- `docs/infrastructure/AWS-HOST.md`
- `requirements.txt`
- https://docs.aws.amazon.com/ses/latest/dg/
