Let me look into how groups and LDAP directories work together in Stalwart.
The most common cause of this is a mismatch between Stalwart’s default LDAP filters/attributes and how Active Directory models groups. Here is what to check:
1. The filterMailbox filter does not match AD groups
Stalwart’s default filterMailbox filter looks for objectClass=groupOfNames, but Active Directory uses objectClass=group. The default will therefore never find your AD group by email address, making delivery fail. You need to override it in your Directory configuration to match AD’s schema. For example:
{
"@type": "Ldap",
"filterMailbox": "(|(& (objectClass=user)(|(mail=?)(mailAlias=?)))(& (objectClass=group)(|(mail=?)(mailAlias=?))))"
}
Adjust the objectClass values to match exactly what your AD uses (user and group are the typical AD classes).
2. The groupClass attribute must match
The groupClass field tells Stalwart which object class identifies a group entry (default is "groupOfNames"). For AD, set it to "group" so the server treats those entries as groups and expands members for delivery.
3. The mail attribute must be set on the AD group
Stalwart looks up groups by their mail attribute (via filterMailbox). Make sure the AD group object actually has a mail attribute set to the group’s email address, since AD does not add this by default.
4. Member expansion with filterMemberOf
The default filterMemberOf is (&(objectClass=groupOfNames)(member=?)). For AD, change groupOfNames to group so Stalwart can correctly enumerate group members during delivery.
The relevant documentation is at:
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.