Split Delivery: Unknown recipients are rejected with "550 Mailbox not found" instead of being relayed

Issue Description

I am trying to use Stalwart’s split delivery feature during a mail migration.

According to the documentation, when a domain has Allow Relaying enabled, messages addressed to recipients that do not exist locally should be accepted and relayed to the configured source server instead of being rejected.

My environment is:

Stalwart Mail Server (latest container image)
Installed with Podman on AlmaLinux
RocksDB backend
Reverse proxy in front of Stalwart
Domain has Allow Relaying enabled
A routing rule is configured to relay unknown recipients for example. com to the source mail server.

The problem is that when an email is sent to a mailbox that does not exist on Stalwart but does exist on the source mail server, Stalwart rejects the recipient during the RCPT TO stage instead of relaying it.

The bounce contains:

550 5.5.0 Mailbox not found

The rejection is generated by Stalwart (host ‘localhost’ rejected command ‘RCPT TO’), and no connection is made to the configured relay destination.

Expected Behavior

When Allow Relaying is enabled for a domain, unknown local recipients should be accepted and forwarded to the configured relay destination, as described in the Split Delivery documentation.

Expected flow:

Recipient is not found locally.

  1. Stalwart accepts the recipient because relaying is enabled.
  2. Stalwart connects to the configured remote SMTP server.
  3. The remote server performs the final recipient lookup and delivers the message.

Actual Behavior

Instead of relaying the message, Stalwart immediately rejects the recipient during the SMTP session with:

550 5.5.0 Mailbox not found

The relay route is never used, and no outbound SMTP connection is attempted.

Reproduction Steps

  1. Install the latest Stalwart Mail Server using Podman.
  2. Create a domain such as example. com.
  3. Enable Allow Relaying for the domain.
  4. Configure a routing rule that forwards unknown recipients for example. com to another SMTP server.
  5. Ensure a mailbox exists only on the source server (not on Stalwart).
  6. Send an email to that mailbox through Stalwart.
  7. Observe that Stalwart rejects the recipient with 550 Mailbox not found instead of relaying it.

Relevant Log Output

No useful log output is produced, even after reproducing the issue.

SMTP delivery report:

host ‘localhost’ rejected command ‘RCPT TO:[email protected]’ with code 550 (5.5.0) 'Mailbox not found.

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Internal

Directory Backend

OIDC

Additional Context

Host OS: AlmaLinux
Running with Podman using network_mode: host
Reverse proxy in front of Stalwart
Split delivery is being used during a migration from another mail server.
The issue occurs only for recipients that are not local to Stalwart but should be relayed to the source server.
The Allow Relaying option is enabled and saved for the domain.

I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.

on

I have searched this support forum (open and closed topics) and confirm this is not a duplicate.

on

I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.

on

With “Allow relaying” enabled on the domain, an unknown recipient in that domain is supposed to be accepted and queued, not rejected, so the fact that you’re getting a rejection means the flag isn’t actually taking effect for that exact recipient domain. Worth confirming its value directly (for example with stalwart-cli on the specific Domain object) and reloading after any change, since the domain data is cached.

One thing stands out: the message you quoted (550 5.5.0 Mailbox not found, host localhost) doesn’t match Stalwart’s own rejection, which is 550 5.1.2 Mailbox does not exist. That makes me think the bounce text you’re reading may be coming from the reverse proxy or an upstream MTA in front of Stalwart rather than from Stalwart itself, so it’s worth confirming who actually emits it.

And remember split delivery is two parts: the domain flag accepts the mail, but you also need a relay route plus an outbound strategy branch to forward it on to the source server. The full setup is in the migration guide at Configuring the new deployment | Stalwart.

I have had exactly the same problem while trying to use split delivery (some mailboxes being local, others managed by another server).

I had already enabled relaying in the domain’s settings, created a relay route and updated my MTA strategy (with the “is_local_address(rcpt)” condition giving ‘local’ if true and ‘relay’ if false), but it was still not working.

In the end, it was reloading the server’s settings in the “Actions” menu that made the split delivery work. I hope this will help @mehedi ?

In any case, I was also receiving “550 (5.5.0) ‘Mailbox not found.’” error messages, and this shows that they were sent by Stalwart itself.

Thanks @Celeri , This is work after change the MTA.