I seem to have an issue with Virtualmin and emails when I want to create "same" emails for different domains. Here is the setup:
example.com (top level server)
- domain1.com (alias of example.com, with own mail)
- domain2.com (alias of example.com, with own mail)
- domain3.com (alias of example.com, with own mail)
I first created user "name" under domain3.com and in that way got working firstname.lastname@example.org. I also typed email@example.com under "Additional email addresses" just for a good measure, although I didn't really need this one. But all was fine and the process of creating user was a success. At the end, I got user "name.example" which already gave me a hint of troubles that will potentially arise.
Next, I tried to create firstname.lastname@example.org and to simplify future email reading I put email@example.com and info@domain2 under "Additional email addresses". Sure enough, the process failed with an error in the line of "user/email alias already exist".
What I suspect is, that Virtualmin creates new users and/or email aliases with top level server's domain "example". So it wants to create "info.example" user for firstname.lastname@example.org, but also for email@example.com and firstname.lastname@example.org.
When I checked Users and Groups under Webmin, sure enough, there was a mess with "info.example" users. The user was there but was under strange group 503. When I deleted a user, a process was successful, but there was again same user "info.example" on the list, but this time with a different home directory path. So at the end, I had to delete user "info.example" multiple times, each time deleting the one with an own specific home directory.
Is there a way to force Virtualmin to create a user with domain alias and not top level server? For example, for email@example.com, the user should be info.domain1 and not info.example. I already checked under Virtualmin -> System settings -> Server templates -> Mail for domain -> Format for usernames that include domain , but none of the options was an obvious choice to force username creation that would use alias domain instead of top level server's domain.
Any idea what to do? Any kind of direction/help would be much appreciated.