Domain aliases not (automatically) working for mailing lists for said domain

Issue Description

When sending an email to a mailing list called [email protected] for the main domain example.tld with alias domain example.alt, the connection is excepted but rejected with relay not allowed

INFO Relay not allowed (smtp.relay-not-allowed) listenerId = "smtp", localPort = 25, remoteIp = <REDACTED>, remotePort = 40953, to = "[email protected]"

Expected Behavior

The email should be delivered properly to the mailing list

Actual Behavior

The email is rejected with Relay not allowed

Reproduction Steps

  1. Standard Stalwart instance
  2. Add a domain
  3. Add to the domain from step 2 an alias domain
  4. Create mailing list on domain from step 2
  5. Send to the mailing list via the alias domain

Relevant Log Output

INFO Relay not allowed (smtp.relay-not-allowed) listenerId = "smtp", localPort = 25, remoteIp = <REDACTED>, remotePort = 40953, to = "[email protected]"

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

PostgreSQL

Blob Storage

PostgreSQL

Search Engine

PostgreSQL

Directory Backend

Internal

Additional Context

Sending to a user account via the domain alias does work, so it seems to be a problem with mailing list handling.

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

Actually, it also does not work for normal user accounts.

As in for domain example.com with alias alias.com and user [email protected]. If you send an email to [email protected], you will get a mailbox not found error.

This is also not something that you can fix, with adding an extra alias to your [email protected] account as the alias domain is not a real domain.

@stalwart is this a user error for alias domains?

Somebody made a PR for exactly this issue (auto closed because of current contribution guidelines)