@sayedhfatimi/convex-email 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ A provider-neutral email component for [Convex](https://convex.dev). One client
|
|
|
9
9
|
- Inbound mail (Resend receiving, SES receipt rules, or raw MIME you hold) is parsed, cleaned, threaded and handed to your `onInbound` function.
|
|
10
10
|
- Optional tenants: one deployment can serve several customers, each with their own provider account.
|
|
11
11
|
|
|
12
|
-
Status: 0.1.
|
|
12
|
+
Status: released (0.1.x) and tested live against Resend and Amazon SES. What was confirmed, and what is still open, is under [Verified live, and what is not yet](#verified-live-and-what-is-not-yet).
|
|
13
13
|
|
|
14
14
|
The component runs entirely in Convex's default runtime. Components cannot contain `"use node"` files, so HTML cleaning, SNS signature checks and SigV4 signing all use runtime-neutral libraries.
|
|
15
15
|
|
|
@@ -570,7 +570,7 @@ Resend dedupes sends through the `Idempotency-Key` header, which the component s
|
|
|
570
570
|
|
|
571
571
|
## Amazon SES set-up
|
|
572
572
|
|
|
573
|
-
1. **Identity.** Verify the domain (or address) you send from in SES, in the region you will use, and move the account out of the sandbox.
|
|
573
|
+
1. **Identity.** Verify the domain (or address) you send from in SES, in the region you will use, and move the account out of the sandbox. While the account is still in the sandbox, SES only delivers to verified identities, and it checks the sender's IAM permission against the **recipient's** identity as well. So add each verified recipient's identity ARN (for example `arn:aws:ses:<region>:<account>:identity/you@example.org`) to the `ses:SendEmail` resources in step 5, or every send to it fails with `AccessDeniedException`. SES's mailbox simulator addresses are exempt.
|
|
574
574
|
2. **Configuration sets, one per stream.** Create a configuration set for the transactional stream (and a second one for bulk if you want separate reputation and metrics). Add an event destination to each that publishes to an SNS topic, with the event types `Send`, `Delivery`, `DeliveryDelay`, `Bounce`, `Complaint`, `Reject` and `Rendering Failure`. Return them as `configurationSets: { transactional, bulk? }`; a bulk send uses the transactional set when no bulk one is given.
|
|
575
575
|
3. **SNS to the webhook.** Subscribe each topic over HTTPS to `https://<deployment>.convex.site/email/webhook/ses` (or the per-tenant route). The component confirms the subscription itself. It verifies every SNS message signature (the signing certificate is fetched only from an `sns.<region>.amazonaws.com` host) and refuses topics that are not listed: put every topic ARN, including the inbound one, in `trustedTopicArns`. A failed verification is a 401; a certificate that cannot be fetched (network error, timeout, non-2xx) is a 500, so SNS delivers the message again.
|
|
576
576
|
4. **Inbound (optional).** Verify the receiving domain's MX record, create an S3 bucket, and add a receipt rule with an S3 action that writes to the bucket and notifies an SNS topic (the notification must carry the bucket and object key, so set the topic on the S3 action). Subscribe the topic to the same webhook. List the bucket in `inboundBuckets`: the adapter will only read buckets named there, and with none listed it refuses all inbound fetches. SES receiving is only available in some regions.
|
|
@@ -605,7 +605,7 @@ The `ses:FromAddress` condition stops the key from being used to send as any oth
|
|
|
605
605
|
|
|
606
606
|
Return `{ provider: "ses", region, accessKeyId, secretAccessKey, sessionToken?, configurationSets, trustedTopicArns, inboundBuckets }` from your callback.
|
|
607
607
|
|
|
608
|
-
SES chooses the `Message-ID` itself, so the component sends none
|
|
608
|
+
SES chooses the `Message-ID` itself, so the component sends none. It records the id SES puts in the delivered header, `<MessageId@<region>.amazonses.com>` (`<MessageId@email.amazonses.com>` in us-east-1). SES's events carry only the bare `MessageId`, without `@`, which is never allowed to replace it. Replies quote the full form in `In-Reply-To`, so they thread. The tenant, when there is one, is sent as the SES `TenantName`.
|
|
609
609
|
|
|
610
610
|
## Capabilities
|
|
611
611
|
|
|
@@ -676,14 +676,23 @@ export const exampleCrons = () => {
|
|
|
676
676
|
|
|
677
677
|
where `internal.email.cleanup` is the `internalMutation` in the example app that calls `mail.cleanup(ctx, { olderThanMs: 90 * 24 * 60 * 60 * 1000 })`.
|
|
678
678
|
|
|
679
|
-
##
|
|
679
|
+
## Verified live, and what is not yet
|
|
680
680
|
|
|
681
|
-
|
|
681
|
+
Checked against the real services on 2026-12-03, on Resend and on SES in eu-north-1 (in the sandbox):
|
|
682
682
|
|
|
683
|
-
-
|
|
684
|
-
-
|
|
685
|
-
-
|
|
686
|
-
-
|
|
683
|
+
- **Resend** replaces the component's `Message-ID` with its own. The component records the real one from the events, and replies thread.
|
|
684
|
+
- **SES** delivers the header `<MessageId@eu-north-1.amazonses.com>`, which the component records, and replies thread.
|
|
685
|
+
- **Resend's Receiving API and its `email.received` webhook** match the adapter. The test fixtures are captured real payloads, with personal data replaced.
|
|
686
|
+
- **Bounces and complaints** (both providers' simulators) suppress the address, and a late `delivered` event does not undo a complaint.
|
|
687
|
+
- **Inbound on SES** works end to end (MX, receipt rule, S3, SNS, the component), with SES's own SPF/DKIM/DMARC verdicts.
|
|
688
|
+
- **Switching providers** (`sendVia` from SES back to Resend) keeps suppressions.
|
|
689
|
+
|
|
690
|
+
Not yet verified live:
|
|
691
|
+
|
|
692
|
+
- The us-east-1 SES header host (`email.amazonses.com`), which is covered by tests only.
|
|
693
|
+
- A send for a tenant on SES (SES `TenantName`).
|
|
694
|
+
- A late Resend event arriving after switching to SES.
|
|
695
|
+
- How large a message the default runtime can send and receive. The 10 MiB cap is deliberately conservative until then.
|
|
687
696
|
|
|
688
697
|
## Development
|
|
689
698
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sayedhfatimi/convex-email",
|
|
3
3
|
"description": "A provider-neutral email component for Convex, with Resend and Amazon SES adapters.",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "sayedhfatimi",
|
|
7
7
|
"homepage": "https://github.com/sayedhfatimi/convex-email#readme",
|