Accounts not provisioned through mailing list

Issue Description

  • Use LDAP Directory
  • Create a mailing list with user1, where user1 is not yet provisioned on stalwart
  • Send a mail to the mailing list

Expected Behavior

  • User1 should be provisioned, as it would be the case when directly sending a mail to user1

Actual Behavior

The mail is rejected with „Mailbox not found“

Stalwart Version

v0.16.x

Installation Method

Docker

Database Backend

RocksDB

Blob Storage

RocksDB

Search Engine

Internal

Directory Backend

LDAP

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

Let me research how Stalwart handles mailing list delivery and LDAP-based account provisioning.

This is very revealing. The source code makes the behavior clear. Here is the explanation:

When a message arrives for a mailing list address, Stalwart expands the list’s recipients into individual RCPT TO addresses. Each expanded member address then goes back through recipient resolution. For an LDAP-backed domain, the code path at resolution time does this:

  1. It first checks if an external directory is configured and can do recipient lookups – if so, it calls directory.recipient(address) and, if an Account or Group is returned, it calls synchronize_account / synchronize_group to provision the account, then accepts. :white_check_mark:

  2. If no external directory is configured (or the directory returned Recipient::Invalid), it falls through to the internal registry (cached email addresses). If the user has never logged in or received a direct email before, they won’t be in the registry, so this returns UnknownRecipient → “Mailbox does not exist.” :cross_mark:

The critical check is: does the mailing list’s domain have an LDAP directory attached to it, and does that directory’s filterMailbox return a valid match for the expanded member’s address?

The most likely cause of your issue is one of:

  • The mailing list recipients use a domain that is not associated with your LDAP directory. If the list is managed internally (stored in the Stalwart registry) but the members’ addresses belong to a domain where Stalwart looks them up via LDAP, the directory lookup should provision them – but only if the domain’s directory is correctly linked.

  • The mailing list itself is defined internally (in Stalwart’s registry) rather than as an LDAP group. In this case, when Stalwart expands the members, it resolves each member through rcpt_resolve again. If the member’s domain has an LDAP directory attached, the lookup should trigger provisioning. Check that the domain associated with the members is actually configured to use your LDAP directory.

  • Your LDAP filterMailbox does not match the member’s address. If filterMailbox returns no entry for user1, the directory returns Recipient::Invalid, no provisioning happens, and the fallback is UnknownRecipient.

What to check:

  1. Confirm that the domain used by user1’s address has the LDAP directory configured as its directory backend in Stalwart.
  2. Verify your LDAP filterMailbox filter returns a result when queried for user1’s exact email address.
  3. Try sending a direct email to user1 (not via the list) and confirm it provisions correctly – this tests the same code path.

You can find the LDAP filter configuration docs here:

And the mailing list recipient docs here:

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong. If you found it useful, mention @helpbot in any reply to ask follow-up questions and the bot will respond again.

Mailing list cannot be defined via LDAP.

Since everything works if the account is directly addressed, so I still assume it’s a bug.

Provisioning accounts via mailing list expansion will be supported in v0.16.6.