-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Description
Problem
The gateway's HTTP hook endpoint returns 202 Accepted for successfully dispatched webhook requests (server-http.js lines 81 and 128).
Forward Email (forwardemail.net), a popular email forwarding service, requires webhook endpoints to return 200 — any other status code is treated as a failure. This causes Forward Email to send 550 bounce notifications back to the original sender, even though the webhook was successfully received and processed.
The error in Forward Email's logs shows:
550 Message delivered to hello@example.com; 202 Accepted Error for hello@example.com
Webhook: 202 UND_ERR_RESPONSE
Root Cause
In dist/gateway/server-http.js:
// Line 81 (direct agent hook)
sendJson(res, 202, { ok: true, runId });
// Line 128 (mapped hook)
sendJson(res, 202, { ok: true, runId });Forward Email's docs state:
Webhook HTTP requests will retry up to 3 times per SMTP connection attempt with a 60 second timeout. If a webhook does not respond with a 200 status code, the response will be stored in an error log.
Suggested Fix
Either:
- Change the default to 200 — semantically
200 OKis fine since the response body already includes{ ok: true, runId }confirming acceptance - Make it configurable — add a
hooks.responseCodeor per-mappingackCodeconfig option so users can set it to 200 for services that require it
Workaround
Manually patching server-http.js to return 200 instead of 202 fixes the issue, but the patch is lost on every npm update.
Environment
- OpenClaw v2026.1.30
- Forward Email webhook integration
- Gateway behind Cloudflare tunnel