VMin user vs OS user

SYSTEM INFORMATION
OS type and version RHEL 9.0
Webmin version 2.001
Virtualmin version 7.3

When installing the OS, I create a new user for myself as well as root.

However, if I then create a new user within a hosted domain on that server which has the same username but @domain name, the 2 accounts get mixed up for email. I am using webmin webmail port 2000.

Incoming email for user@domain ends up in /home/domain/homes/user/Maildir/new but doesn’t show anywhere using Webmail.

Outgoing email sent from user@domain ends up in /home/user/Maildir/.sentmail/cur and shows in Sent mail for both the OS user and the domain user.

I have tested this on 2 Virtualmin systems, the other being RHEL 9.1.

The simple option is for me to delete the OS user and create something else but I imagine that someone else will run into this problem at some point.

I don’t understand what you’re describing.

In Virtualmin, the domain name is generally the name of an account that will manage the domain…but, not receive mail (though it could…it’s not how it’s normally configured, and the way you’d send to that account would seem weird, as it wouldn’t be in the virtual map file).

Once you have a domain administration account, you’d then create your users within that domain (these mail users are also system users, but with fewer privileges, and homes in /home/domainname/homes, and they do not have Webmin access, only Usermin).

It’s not the domain admin account.

When first installing RHEL I create a user for myself to use with sudo etc. eg. fred

Then I install VMin, Create a domain in VMin, then I create a user within the domain that happens to have the same name as the user I use for RHEL, but is fred@newdomainname.

There might be other user names in that domain, it’s just the one with the part before the @ that matches the username in RHEL that has the problem.

The mails I am sending from external mail server are to fred@newdomainname.

Ah, you’re using the wrong username to login. When you create a new user with the same name as an existing one it has to add the domain to it, in order to avoid a conflict (no matter what configuration you have for how to name email and FTP users). There cannot be two fred users on a system.

Look at the Edit Users page. It will tell you the login name of your user. It is probably simply fred@domain.tld (and not fred, which is your other user named fred that does not belong to a domain, and would only receive mail if you send it to fred@server-hostname.tld, unless you add your own entries to the virtual map).

I will test this further, but would it be a good idea to make UMin not accept logins without the domain name?

Joe, testing shows that you were right.

It also shows that it doesn’t matter which domain I load Umin in, it only depends on the username.

So I can use domain1.com:20000 then login as user@domain2.com and it will accept it. Not really a problem, just checking that this is expected behaviour.

It does. If you visit Usermin on https://domain.tld:20000 and try to login as joe and there is not a joe user, but there is a joe@domain.tld user, it will be logged in.

But, you have two users. How would you login as fred if you also have a fred@domain.tld and expect both to be able to login to Usermin?

To be clear, the issue here is that you have this extra user that was created outside of Virtualmin that happens to conflict with a Virtualmin user; Virtualmin and Usermin are doing the best they can to accommodate that, but I don’t know how it could possibly handle this in the way you want without breaking one of the two users in Usermin.

Anyway, it’s not a common pattern. Just doesn’t really come up, so it’s not been something we’ve ever thought much about. :man_shrugging: