cloudflare-email 0.1.0 → 0.2.0
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +73 -1
- data/README.md +265 -388
- data/SECURITY.md +51 -0
- data/app/controllers/cloudflare/email/ingress_controller.rb +62 -6
- data/docs/activerecord-tenanted.md +135 -0
- data/docs/architecture.md +95 -0
- data/docs/delivery-events.md +177 -0
- data/docs/features.md +107 -0
- data/docs/getting-started.md +298 -0
- data/docs/mailboxes.md +299 -0
- data/docs/outbox.md +175 -0
- data/docs/tenant-mailboxes-plan.md +149 -0
- data/docs/thread-correlation.md +27 -0
- data/docs/troubleshooting.md +103 -0
- data/docs/upgrading-0.2.md +96 -0
- data/docs/verification/2026-09-10-followup.md +49 -0
- data/docs/verification/2026-09-10-install-upgrade.md +86 -0
- data/docs/verification/2026-09-10-live.md +102 -0
- data/docs/verification/2026-09-10.md +175 -0
- data/docs/verification/2026-09-11-extraction.md +32 -0
- data/docs/verification/2026-09-11-outbound-ledger.md +60 -0
- data/docs/verification/2026-09-11-security.md +76 -0
- data/docs/verification/2026-09-11-tenant-mailboxes.md +75 -0
- data/examples/plain_ruby.rb +24 -0
- data/lib/cloudflare/email/active_record/base.rb +48 -0
- data/lib/cloudflare/email/active_record/delivery_events.rb +72 -0
- data/lib/cloudflare/email/active_record/event_inbox.rb +77 -0
- data/lib/cloudflare/email/active_record/event_receipt.rb +17 -0
- data/lib/cloudflare/email/active_record/mail_snapshot.rb +24 -0
- data/lib/cloudflare/email/active_record/outbound_delivery.rb +22 -0
- data/lib/cloudflare/email/active_record/outbound_recipient.rb +13 -0
- data/lib/cloudflare/email/active_record/outbound_reconciliation.rb +15 -0
- data/lib/cloudflare/email/active_record/outbox.rb +219 -0
- data/lib/cloudflare/email/active_record/outbox_notifications.rb +34 -0
- data/lib/cloudflare/email/active_record.rb +5 -0
- data/lib/cloudflare/email/client.rb +51 -11
- data/lib/cloudflare/email/consume_events_task.rb +22 -0
- data/lib/cloudflare/email/delivery_event.rb +70 -0
- data/lib/cloudflare/email/delivery_method.rb +3 -0
- data/lib/cloudflare/email/deploy_worker_task.rb +3 -0
- data/lib/cloudflare/email/dev_ingress_guard.rb +27 -0
- data/lib/cloudflare/email/dev_tunnel.rb +31 -5
- data/lib/cloudflare/email/doctor.rb +16 -38
- data/lib/cloudflare/email/endpoint.rb +24 -0
- data/lib/cloudflare/email/engine.rb +28 -0
- data/lib/cloudflare/email/envelope.rb +58 -0
- data/lib/cloudflare/email/event_consumer.rb +86 -0
- data/lib/cloudflare/email/mailboxes/configuration.rb +58 -0
- data/lib/cloudflare/email/mailboxes/events.rb +112 -0
- data/lib/cloudflare/email/mailboxes/inbound_retention.rb +14 -0
- data/lib/cloudflare/email/mailboxes/jobs.rb +34 -0
- data/lib/cloudflare/email/mailboxes/models.rb +148 -0
- data/lib/cloudflare/email/mailboxes/provider_correlation.rb +11 -0
- data/lib/cloudflare/email/mailboxes/service.rb +288 -0
- data/lib/cloudflare/email/mailboxes/shared_event_receipt.rb +14 -0
- data/lib/cloudflare/email/mailboxes.rb +11 -0
- data/lib/cloudflare/email/message_id.rb +12 -0
- data/lib/cloudflare/email/provision_catchall_task.rb +4 -4
- data/lib/cloudflare/email/provision_route_task.rb +2 -1
- data/lib/cloudflare/email/replay_events_job.rb +18 -0
- data/lib/cloudflare/email/response.rb +21 -3
- data/lib/cloudflare/email/routing_provisioner.rb +71 -45
- data/lib/cloudflare/email/send_job.rb +41 -0
- data/lib/cloudflare/email/send_test.rb +5 -29
- data/lib/cloudflare/email/signing.rb +2 -2
- data/lib/cloudflare/email/tenancy.rb +78 -0
- data/lib/cloudflare/email/tenant_job_context.rb +90 -0
- data/lib/cloudflare/email/verification.rb +30 -8
- data/lib/cloudflare/email/version.rb +1 -1
- data/lib/cloudflare/email/worker_deployer.rb +5 -3
- data/lib/cloudflare-email.rb +4 -1
- data/lib/generators/cloudflare/email/install_generator.rb +48 -33
- data/lib/generators/cloudflare/email/mailboxes/mailboxes_generator.rb +55 -0
- data/lib/generators/cloudflare/email/mailboxes/templates/create_cloudflare_email_mailboxes.rb +54 -0
- data/lib/generators/cloudflare/email/mailboxes/templates/create_cloudflare_email_receiving_domains.rb +16 -0
- data/lib/generators/cloudflare/email/mailboxes/templates/create_cloudflare_email_shared_events.rb +35 -0
- data/lib/generators/cloudflare/email/outbox/outbox_generator.rb +28 -0
- data/lib/generators/cloudflare/email/outbox/templates/create_cloudflare_email_outbox.rb +48 -0
- data/lib/generators/cloudflare/email/templates/initializer.rb +3 -3
- data/lib/generators/cloudflare/email/templates/main_mailbox.rb +2 -7
- data/lib/generators/cloudflare/email/tracking/templates/create_cloudflare_email_event_receipts.rb +22 -0
- data/lib/generators/cloudflare/email/tracking/tracking_generator.rb +26 -0
- data/lib/tasks/cloudflare_email.rake +41 -4
- data/templates/worker/README.md +61 -11
- data/templates/worker/package-lock.json +2627 -0
- data/templates/worker/package.json +8 -5
- data/templates/worker/scripts/wrangler.mjs +16 -0
- data/templates/worker/src/index.js +83 -4
- data/templates/worker/test/index.test.ts +117 -5
- data/templates/worker/wrangler.toml +13 -4
- metadata +107 -6
- data/lib/cloudflare/email/secure_message_id.rb +0 -89
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5188438b941345c4164baca6ab1400e2fc74259c5fdd209a6d2ed9ac618147b5
|
|
4
|
+
data.tar.gz: 5e3a6ff25c460c0a73ffb3fdf44dcc62f87679f4278e328c605291d62de35fa9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 77fe9d9c571311065e9d10d00e2c021156113ff63dec5a970f63456a6cee9d3413bfe157dcfd8e37992e5b747e1ab957d342bfc01a399d41e2c3838462067aa3
|
|
7
|
+
data.tar.gz: bf580baaec84aa3dc8894f0fbc9b770ca4fe2521a1534b248fe75bd67812a40adaf4538d321a7740b911b1fc42b80e5fd468418c4d804d635f5496710591add6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,78 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 0.2.0 — 2026-09-11
|
|
4
|
+
|
|
5
|
+
- Add optional managed mailboxes: domain directory, addresses/aliases, lifecycle,
|
|
6
|
+
incoming memberships, read/archive/purge APIs and raw-mail retention.
|
|
7
|
+
- Add explicit tenant connections, tenant-aware framework and mailbox jobs,
|
|
8
|
+
mailbox-authorized outbox sends, shared event intake/correlation and recovery.
|
|
9
|
+
Verify separate SQLite databases and actual `activerecord-tenanted` integration;
|
|
10
|
+
no new runtime dependency for plain Ruby consumers.
|
|
11
|
+
- Add a mailbox generator with separate shared/tenant migration paths and
|
|
12
|
+
user guides for mailbox management and database tenancy.
|
|
13
|
+
|
|
14
|
+
- Bound Rails and Worker inbound reads to 25 MiB by default; reject malformed or
|
|
15
|
+
stale signing headers before reading MIME. Require HTTPS remote endpoints.
|
|
16
|
+
- Restrict the development tunnel to email ingress and require a running guard;
|
|
17
|
+
redact client inspection, retry logs, and generated mailbox logging.
|
|
18
|
+
- Validate delivery-event schemas, preserve receipt evidence through ordinary
|
|
19
|
+
ActiveRecord updates, and tighten provider acceptance response handling.
|
|
20
|
+
- Remove Rails 7.1 support, update patched Rails/SQLite test floors, and audit
|
|
21
|
+
resolved Ruby dependencies in CI. See the dated security verification report.
|
|
22
|
+
|
|
23
|
+
- Add an optional durable Rails outbox: immutable MIME/envelope snapshots,
|
|
24
|
+
account-scoped operation keys, committed send claims, per-recipient acceptance
|
|
25
|
+
evidence, blocked uncertain retries, and audited subset reconciliation.
|
|
26
|
+
- Add `Outbox.prepare_mail`, identity-only `SendJob`, replay jobs/tasks and
|
|
27
|
+
`DeliveryEvents` to correlate provider events and update recipient lifecycle
|
|
28
|
+
state transactionally. Normalize receipt message IDs for indexed replay.
|
|
29
|
+
- Verify concurrent sends and event projection on PostgreSQL as well as SQLite;
|
|
30
|
+
include process termination, partial outcomes and post-acceptance persistence
|
|
31
|
+
failures. The inbox uses the shared ledger with preserved historical records.
|
|
32
|
+
|
|
33
|
+
- Authenticate SMTP envelope sender/recipient with the Worker's v2 HMAC format,
|
|
34
|
+
persist trusted metadata before routing, and expose `Envelope.for(inbound_email)`.
|
|
35
|
+
Preserve raw MIME and scope duplicate detection to the exact SMTP recipient.
|
|
36
|
+
Require v2 ingress; remove v1 compatibility and the unused signed Message-ID
|
|
37
|
+
helper. Coordinate Rails and Worker deployment; see docs/upgrading-0.2.md.
|
|
38
|
+
|
|
39
|
+
- Extract shared provider acceptance, delivery-event ordering, and Message-ID
|
|
40
|
+
normalization primitives from the inbox application.
|
|
41
|
+
- Add an opt-in ActiveRecord event inbox and `cloudflare:email:tracking` generator:
|
|
42
|
+
committed receipts before ACK, account/event uniqueness, payload-conflict
|
|
43
|
+
detection, unmatched replay, and transactional handlers with explicit outcomes.
|
|
44
|
+
|
|
45
|
+
- Verify actual local workerd-to-Rails delivery in CI. This exposed and fixed an
|
|
46
|
+
unsupported fetch redirect mode; use `manual` and reject the 3xx response.
|
|
47
|
+
Add reusable package/fresh-install/task verification and a dated evidence report.
|
|
48
|
+
|
|
49
|
+
- Add outbound delivery events through Cloudflare Queues HTTP pull, typed event
|
|
50
|
+
data, account/domain checks, per-message acknowledgement after handler success,
|
|
51
|
+
and a Rails `consume_events` task. Optional Rails receipts provide durable
|
|
52
|
+
deduplication; applications supply correlation and processing policy.
|
|
53
|
+
- Expose suppressed recipients and provider message IDs in responses/notifications;
|
|
54
|
+
support cc/bcc-only structured sends and HTTP-date Retry-After headers.
|
|
55
|
+
- Default to retrying only rate limits and pre-send connection failures. Ambiguous
|
|
56
|
+
network/5xx retries now require `retry_ambiguous: true` to accept duplication risk.
|
|
57
|
+
- Fix generated ENV credentials, send-only eager boot, duplicate ingress responses,
|
|
58
|
+
accidental generator deployment tasks, and development environment isolation.
|
|
59
|
+
- Require subdomain routing DNS preflight; refuse misleading subdomain catch-all
|
|
60
|
+
scope; use current apex DNS API and paginated rule lookup; surface setup failures.
|
|
61
|
+
- Update locked Worker tooling, require explicit Wrangler environments, bound
|
|
62
|
+
forwarding requests to 15 seconds, and reject redirects. Add scheduled CI,
|
|
63
|
+
dependency checks, actual Rails integration tests, and Ruby 4 / Rails 8.1 coverage.
|
|
64
|
+
- Require FROM for test sends; remove undocumented sending-domain discovery and
|
|
65
|
+
misleading diagnostic claims. Update DNS, SMTP, retry, and signed-ID guidance.
|
|
66
|
+
- Bound legacy signed Message-ID output to 900 bytes; reject empty decode secrets.
|
|
67
|
+
Live Cloudflare testing confirmed custom IDs are replaced; use provider IDs
|
|
68
|
+
for correlation, not sender authentication. See docs/upgrading-0.2.md.
|
|
69
|
+
- Accept plain JSON queue bodies returned by live Email Sending subscriptions,
|
|
70
|
+
retaining Base64 compatibility. Verify real delivery-event redelivery and ack.
|
|
71
|
+
|
|
72
|
+
## 0.1.0 — 2026-04-18
|
|
73
|
+
|
|
74
|
+
The notes below describe the original April implementation and its historical
|
|
75
|
+
verification. Current compatibility and security guidance is in the 0.2.0 docs.
|
|
4
76
|
|
|
5
77
|
- **`Cloudflare::Email::SecureMessageId`** — sign the outbound `Message-ID:`
|
|
6
78
|
with HMAC-SHA256. The recipient's reply naturally carries the signed id
|