Your Worker passes locally, but you still don’t know whether a real message reaches it.

Fastest safe approach: use Wrangler’s local email route to test the Worker’s message handling, then check the configured route and send a real message from an independent mailbox before treating inbound delivery as verified.

Who should read this: Developers building a Cloudflare Email Routing Worker can test parsing and processing locally.
QA engineers can separate code regression results from real-receipt acceptance.
Small teams maintaining staging or production routes can see when external verification is still needed.

Cloudflare Email Routing inbound email testing: what each test proves

Treat local handler testing, route configuration, and external receipt as separate evidence. They answer different questions:

  • Local handler test: Does the Worker process the supplied message as expected?
  • Route configuration check: Is the domain and configured destination or Worker route set up as intended?
  • External receipt test: Does a message sent through the live route reach the Worker or the expected forwarding destination?

A pass in one category does not imply a pass in the others. In particular, a locally triggered message does not verify live DNS records, MX routing, or delivery by an external sender. Cloudflare’s documentation describes local development and route setup as distinct steps: see the local routing test guide and the inbound email routing setup guide.

This separation also keeps the scope clear. This guide covers inbound messages handled by Email Routing and Workers. It is not a guide to configuring Cloudflare Email Service for outbound sending.

What can Wrangler local email testing verify?

For local development, start the Worker with Wrangler and submit a sample email to the local email handler endpoint described in Cloudflare’s Wrangler routing documentation. The documented approach uses an HTTP request with a raw email message as its body. A typical shell pattern is:

curl --request POST "$BASE_URL/cdn-cgi/handler/email" \
  --header "Content-Type: message/rfc822" \
  --data-binary @sample.eml

Set BASE_URL to the local URL Wrangler reports. Keep the message in a .eml fixture so you can change its headers and body without rebuilding the request by hand. The local request enters the development handler; it is not a message sent through a public mail server.

Use the fixture to test the behaviour your own product needs. Check whether the handler reads the sender and recipient as expected, selects the right processing branch, and handles the body or attachments your application supports. The Workers email handler API documents the handler interface and the message properties available to it, including sender, recipient, headers, and raw message content.

There is a useful boundary here: your test proves only what the fixture actually contains and what your assertions actually check. If the fixture has no attachment, a passing run says nothing about attachment handling. If your assertion checks only the subject, it says nothing about whether the body was parsed correctly.

For message structure, RFC 5322 specifies that a message has header fields followed by a body, separated by an empty line. It also says a line should not exceed 78 characters and must not exceed 998 characters, excluding the line break. These limits can inform fixtures for header-folding or long-line cases; they do not establish that a live route or external mailbox will accept the message. See the RFC 5322 message format and line-length rules.

Local handler scenario

A practical local scenario is a registration confirmation message from your own staging application. Save a representative email as a fixture, then run the Worker locally and assert the outcome your handler should produce: for example, whether it recognizes the intended recipient and selects the correct processing path.

Keep expected and actual results explicit. A compact test record could contain:

  • Input: fixture name and the sender, recipient, subject, body type, and attachment conditions it represents.
  • Expected result: the branch the handler should take, such as accept, transform, forward, or reject, according to your own implementation.
  • Observed result: the handler output or other local evidence you use to judge the run.
  • Scope: local handler logic only.

The last line matters. A passing fixture confirms neither that the configured domain receives mail nor that your route invokes this Worker. Avoid writing “email delivery passed” in a test report when what passed was a local handler assertion. Record it as “local message processing passed” instead.

Wrangler local email testing is also useful when a change affects parsing or routing decisions. Keep a small, stable fixture set under version control, with synthetic data rather than real customer addresses or personal information. That makes regression runs repeatable and reduces the chance of exposing personal data in test logs or shared development environments.

Route configuration scenario

A correct handler can still sit behind an incorrect route. Before sending a live test message, inspect the domain setup and route configuration in the Cloudflare dashboard. Confirm that the intended domain is configured, that the recipient address or matching rule points to the expected Worker or destination, and that the test address you plan to use actually matches that rule. Cloudflare’s domain configuration documentation describes the domain setup involved.

Do not treat a visible configuration as proof that a message has been processed. It establishes what the control plane is configured to do; it does not establish that a specific message arrived at the Worker. For your test notes, record the route you expected to match and the processing evidence you observed separately.

A useful scenario is a staging address intended to invoke a Worker. First verify that the route’s recipient or rule corresponds to that address. Then, when you run the live test, check the Worker’s processing result rather than relying only on the dashboard entry. If your design forwards a message onward, check the destination as well. The expected result depends on the action your own route is configured to take.

Real external receipt scenario

A live acceptance test answers the question a local request cannot: does an independently sent message travel through the configured route and produce the expected result? Use a mailbox that is separate from the forwarding destination you are trying to verify. Send a controlled message to the intended routed address, then inspect the Worker’s result or the expected forwarded inbox.

Sending from a different mailbox reduces ambiguity. If you send from the same mailbox you are checking as the destination, an already-open conversation, mailbox rule, or an incorrect assumption about the sender and recipient can make it harder to identify which copy you are inspecting. An independent sender makes the test path easier to trace; it does not guarantee delivery by itself.

If the message is missing, investigate in stages rather than assuming one cause:

  • Check the destination mailbox: look in spam or junk as well as the primary inbox.
  • Recheck the address: confirm that the test message went to the exact recipient covered by the route.
  • Inspect the matching rule and action: verify that the address or rule selects the Worker or forwarding destination you intended.
  • Check Worker evidence: determine whether the message reached the handler and what processing result it produced.
  • Separate route failure from destination visibility: if the Worker handled the message but the expected forwarded copy is absent, investigate the forwarding or mailbox side rather than calling it a local parsing failure.
A successful local request is evidence about your Worker’s local processing, not evidence about public DNS, MX routing, or external mailbox delivery.

How do you confirm Email Routing handed a message to your Worker?

Look for evidence from the actual live test, not only from the route settings. The strongest practical signal is that your Worker’s processing path records or produces the expected result for the message sent from the independent mailbox. If your route is meant to forward the message, also inspect the intended receiving inbox.

Keep the message identity and outcome together in your test record. Record enough characteristics to distinguish the test message—such as its intended recipient and subject—alongside the expected route and the observed Worker or forwarding result. Avoid logging real personal content unless your test requires it; synthetic fixtures and controlled test messages are easier to share and safer to retain.

If the live test produces no Worker evidence, that does not by itself identify the failure point. Review the address and route match, then compare the result with the Worker’s own evidence. If the Worker did process the message but the final inbox does not show it, the handler path and the recipient mailbox need separate investigation. Don’t collapse these outcomes into a single “email failed” status.

A test plan that keeps the evidence honest

Use a scenario-based record so each result supports only the claim it actually proves:

Test option What it checks What it does not prove Best use
Wrangler local request Worker logic against the supplied message Live DNS, MX routing, or external receipt Parser and handler regression
Route configuration review Domain and route settings match your intended design That a specific message reached the Worker Pre-test configuration check
Message from an independent mailbox Live route processing and expected receipt, when observed Behaviour for every sender or mailbox provider Pre-release or post-configuration acceptance

For a repeatable run, follow this sequence:

  1. Define the claim you need to prove. Decide whether you are testing handler logic, route setup, live Worker processing, or the final forwarding destination. Keep these outcomes separate.
  2. Prepare a synthetic message fixture. Include only the headers, body format, and attachment conditions relevant to the case. Use invented addresses and content rather than real user data.
  3. Run the local handler test. Start Wrangler, submit the fixture through the documented local endpoint, and check the fields and processing branch your code is expected to handle.
  4. Review the configured domain and route. Confirm that the intended recipient and action correspond to the Worker or forwarding destination under test.
  5. Send a live message from a separate mailbox. Use the exact routed address and a controlled subject so you can find the result without confusing it with unrelated mail.
  6. Inspect both processing and receipt evidence. Check whether the Worker processed the live message, then check the intended destination if the route forwards it.
  7. Label the result by scope. Report local regression, route configuration review, and live receipt as distinct results; if one was not run, mark it as unverified rather than assuming it passed.

This sequence is intentionally conservative. It adds a real external send after local checks, but it prevents a common release mistake: treating a successful local code test as proof that the production mail path works.

If you are validating your own application’s outbound confirmation or notification email, a controlled temporary inbox can be one way to inspect the message as a recipient. It is not a substitute for testing Cloudflare’s route configuration, and one receiving inbox cannot establish how every external mailbox handles delivery. If you need a separate inbox for that inspection, tmpforward’s no-account inbox guide explains that option. For recurring test accounts, compare it with an email alias or disposable address; use a long-term mailbox instead when the account needs reliable recovery or ongoing correspondence. tmpforward is a receiving option for checking your own product’s messages, not a replacement for verifying the live Cloudflare route.

Choose a receiving identity by relationship length

Use a temporary inbox for short-term confirmation; when you need future recovery and notifications, create a dedicated forwarding alias for that site.