# Mail Forwarding

On staging and other non-production environments, mail forwarding redirects every outgoing email to a single inbox. This lets you test flows that send mail — magic links, receipts, notifications — against real addresses without the risk of emailing actual members.

Never runs in production

Mail forwarding is ignored entirely in production. Enabling it has no effect on a production instance, so outgoing mail is always delivered normally there.

## Configuration[​](#configuration "Direct link to Configuration")

Open **Global Settings → Mail** (super-admin only) to configure forwarding:

| Field                         | Description                                                                                                  |
| ----------------------------- | ------------------------------------------------------------------------------------------------------------ |
| **Forward all outgoing mail** | When enabled, every outgoing email is redirected to the forward address below.                               |
| **Forward to**                | The single inbox that captured mail is sent to (for example, a shared QA inbox or a Slack inbound address).  |
| **Bypass addresses**          | One email per line. Messages addressed only to these recipients are delivered normally instead of forwarded. |

Save the page to apply the changes.

## How forwarding works[​](#how-forwarding-works "Direct link to How forwarding works")

When forwarding is enabled on a non-production environment, each outgoing message is checked against the bypass list:

* If **every** recipient (To, Cc, and Bcc) matches a bypass entry, the message is delivered untouched.
* Otherwise the whole message is redirected to the forward address, and its Cc and Bcc recipients are cleared.

When a message is redirected, the original recipients are surfaced three ways so they're easy to spot in a shared forwarding inbox:

* **Subject prefix** — the subject is prefixed with the original recipients in brackets, for example `[user@example.com] Your magic link`.
* **Body banner** — a `Forwarded — originally to: …` banner is added to the top of the message body.
* **`X-Original-To` header** — the original recipients are also preserved in an `X-Original-To` header.

The original recipients are shown exactly as they were addressed — the normalization described below is used only for bypass matching, not for these labels.

## Bypass matching[​](#bypass-matching "Direct link to Bypass matching")

Bypass entries can be literal addresses or `*` wildcard patterns:

```text
qa@example.com
*@example.com
qa-*@example.com

```

Both the message recipients and the bypass entries are normalized before they are compared:

* Addresses are lowercased.
* `+` sub-address tags are stripped (so `jane+test@example.com` matches a bypass entry of `jane@example.com`).
* Gmail addresses are canonicalized further: dots in the local part are removed and `googlemail.com` is treated as an alias of `gmail.com` (so `jane.doe@googlemail.com` matches a bypass entry of `janedoe@gmail.com`). This applies only to `gmail.com` and `googlemail.com` addresses.
