Your question
Summary
When a domain is configured as local (to host send-as aliases/identities at that
domain), an authenticated JMAP EmailSubmission to a recipient at that domain is
rejected with Mailbox does not exist, whereas an authenticated SMTP submission
(port 465) to the exact same recipient is correctly relayed to the outbound route.
Same authenticated user, same envelope — only the submission protocol differs.
Environment
- Stalwart 0.16.20, self-hosted, object/webadmin config model.
- External provider domains (
gmail.com,yahoo.com,orange.fr, …) are added as
local domains so the account can hold aliases + identities at those addresses
(send-as / “send mail as”). - Outbound routing (
MtaOutboundStrategy.route):
is_local_domain(rcpt_domain) && rcpt_domain NOT IN [<those external domains>] -> 'local',
else-> 'router'(a smarthost relay). So these domains are meant to be relayed out.
Expected
An authenticated user submitting to any recipient should follow the outbound routing
(relayed to the smarthost for these domains), regardless of protocol (SMTP vs JMAP).
Actual
- SMTP submission (465, authenticated)
RCPT TO:<[email protected]>→
queue.authenticated-message-queued(queueNameremote) →Routed via <smarthost>→
delivered
- JMAP
EmailSubmission(authenticated,envelope.rcptTo = [{email:"[email protected]"}]) →
smtp.mailbox-does-not-exist→ rejected
(recipient at the local domain is treated
as a local-delivery target instead of being relayed).
Minimal repro
- Add
gmail.comas a local domain (with an alias, for send-as). - Authenticated JMAP
EmailSubmission/set,rcptTo = [email protected]→ fails
mailbox does not exist. - Same authenticated user, SMTP submission (465) to
[email protected]→ relayed/delivered.
Notes
- In the older TOML config this was solved with
session.rcpt.directory = [{ if rcpt_domain=='X' then '*' } ...]+queue.outbound.next-hop
(ref GitHub discussion #1169). The current object/webadmin model doesn’t seem to expose an equivalent. Domain.allowRelaying = truedoes relay these recipients but bypasses authentication
(verified: an unauthenticated SMTP session can then relay to that domain = open relay),
so it isn’t a safe option here.
Request
Is there a supported, authentication-gated way (current config model) to let authenticated
submission — including JMAP — relay recipients at a local send-as domain, without opening
an unauthenticated relay? If not, could JMAP EmailSubmission be made consistent with SMTP
submission (honor the outbound routing / relay for authenticated users)?