Using Stalwart v0.16.16 and FreeIPA as LDAP backend for Stalwart, I want to have user email aliases correctly provisioned. In FreeIPA, email aliases are actually multiple “mail” entry in LDAP. When I check a user account that has multiple mail set in his LDAP account, I don’t see any mail as alias in Stalwart UI.
Moreover, when I try to send an email from an alias, I get this error :
[…]
235 2.7.0 Authentication succeeded.
MAIL FROM:[email protected]
501 5.5.4 You are not allowed to send from this address.
How can I do that ?
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.
This clarifies the issue: Stalwart reads a separate mailAlias attribute for aliases, distinct from the primary mail attribute. FreeIPA stores every additional address as another mail value on the same attribute rather than in a mailAlias attribute, so Stalwart only picks up whichever value it treats as primary and doesn’t see the others as aliases.
Fix: map attrEmail and attrEmailAlias both to FreeIPA’s mail attribute in your LDAP directory config, e.g.:
Since mail in FreeIPA can be multi-valued, having both fields point at it lets Stalwart treat every extra mail value on the entry as an alias in addition to the primary address (the first value returned is typically treated as primary). You should also update filterMailbox/filterLogin if they were customized, though the defaults already match on mail and mailAlias.
After changing the mapping, resynchronize/re-authenticate so Stalwart re-reads the LDAP entries; the aliases should then show up in the WebUI, and the “not allowed to send from this address” error (which is Stalwart’s SMTP submission check verifying the MAIL FROM matches one of the account’s known addresses) should go away once the extra mail values are recognized as aliases.
Already tried that, didn’t work.
Email Aliases in Stalwart UI for the account is still empty. I even tried removing the account then login again to recreate it, still empty Email Aliases list.
Current login filter :
(&(objectClass=inetOrgPerson)(mail=?))
Current Mailbox Filter :
(&(objectClass=inetOrgPerson)(mail=?))