fix(inbox): email worker uses redirect 'manual' (Workers refuse 'error')
Problem
The Inbox Cloudflare Email Worker (.deploy/cloudflare/inbox-email-worker) posts each message with fetch(..., { redirect: 'error' }). The Workers runtime refuses that value:
Invalid redirect value, must be one of "follow" or "manual" ("error" won't be implemented since it does not make sense at the edge; use "manual" and check the response status code).
So on the real runtime every delivery threw, and the sending server retried until it gave up. No mail ever reached the API. Node, where the tests run, accepts 'error', so the suite stayed green.
Found while taking ever.email live. The shared ever-email-router Worker (ever-co/homelab cloudflare/workers/ever-email-router) reuses this module's wire format, and its first live delivery failed with exactly this error.
Fix
redirect: 'manual': a 3xx comes back as is. It is not 2xx, 413 or a definite 4xx, so it lands on the existing "throw → the sender retries" path. A redirect is still never followed with the signed message.- Test: asserts
manual, and that a 301 is a retry (no reject). Without the fix the suite is 7 pass / 1 fail; with it, 8 / 8 (node --test test/worker.test.mjs).
Live check (router, same change)
A Postmark mail to an unknown ever.email address was routed to gauzy-prod=no-mailbox gauzy-stage=no-mailbox and rejected with "No such mailbox", which is the intended outcome.
🤖 Generated with Claude Code
Summary by cubic
Fixes the Inbox Cloudflare Email Worker so mail deliveries no longer throw on the real Workers runtime. Cloudflare Workers refuse fetch redirects set to 'error' ("must be one of follow or manual"), so every delivery failed and the sending server retried until it gave up; Node, where the tests run, accepts 'error', hiding the problem.
The worker now uses redirect: 'manual': a 3xx comes back as-is, lands on the existing retry path, and is never followed with the signed message. The tests assert manual and that a 301 is treated as a retry.