"invalid DN" when adding a forwarding address to an email

SYSTEM INFORMATION
OS type and version Ubuntu 24.04.2 LTS
Webmin version 2.402
Virtualmin version 7.30.8
Webserver version Apache/2.4.58
Related packages slapd 2.6.7

I have set up Virtualmin GPL with LDAP for both user accounts and for Postfix alias maps. User accounts are stored using @ format, and account creation seems to be working fine.

I have found one issue, however: if I set a forwarding address on a user account in Virtualmin, I receive the error:

Failed to save user : LDAP add of mailLocalAddress=mailtest\@domain.net,ou=Aliases,dc=domain,dc=net failed : invalid DN

It seems to not matter whether I create the user first and then add the forward, or if I create the user with a forward. I can create the user without a forward just fine, it’s not until the forward is added that the error appears.

After a lot of debugging, the problem appears to be with the ‘@’. Spamtrap and hamtrap aliases are being created, but they use a ‘-’ instead.

If I try to add the alias in Postfix manually, I receive the error " Failed to save alias : ‘mailtest@domain.net’ is not a valid address."

If I try to directly create the LDAP entry, I recieve the “invalid dn” error if I try to add “mailLocalAddress=mailtest\@domain.net,ou=Aliases,dc=domain,dc=net,” but I CAN add “mailLocalAddress=mailtest@domain.net,ou=Aliases,dc=domain,dc=net” without the escape.

So this is where I’m at. I would like users to log in with their regular email address, which is why I have “Format for usernames that include domain” set to “username@domain.” I’m not sure if this is what is causing a configuration conflict, or if there is a limitation in the Postfix module for LDAP aliases, if I’ve just missed something, or if I’ve stumbled on a bug.

As such, I’m not sure which configuration settings are relevant, so let me know what to provide. Thanks!

As another test, I manually added the following entry into LDAP:

object: mailLocalAddress=mailtest@domain.net,ou=Aliases,dc=domain,dc=net
attribute: mailRoutingAddress: otheremail@otherdomain.com
objectClass: inetLocalMailRecipient

and the forwarding worked perfectly. Mail sent to mailtest@domain.net was forwarded to otheremail@otherdomain.com. It was even processes by SRS correctly. If I look at the Postfix alias table, the entry shows up in Webmin. However, the user account under Virtualmin does not show that forwarding is enabled on the user, nor list the otheremail@otherdomain.com address in the text box.

After taking a different route searching for answers, I finally found this thread: Postfix virtual map escapes some @

It appears that changing Virtualmin Configuration → Advanced options → Create extra Unix user… from “Automatic” to “Yes” has resolved the issue.