Change username for mailadress (mail.domain.nl)

SYSTEM INFORMATION
OS type and version Ubuntu Linux 22.04.5
Webmin version 2.303
Virtualmin version 7.30.8
Webserver version REQUIRED
Related packages SUGGESTED

We have some older users that still have a mailaddress with a login username like mail.domain.nl. This gives us some hard times when installing the mail on external mail programs. Is there a way to change this username?

What problems are you having exactly with it, and how do you expect your logins to look?

Hi Ilia,

The username right now is: mail.domain.nl
We would like it to be: mail@domain.nl
For some mailprograms the mail.domain.nl is not recognized as a mailaddress.
Therefore we are unable to connect them to the mail program.

You can’t have that format as its a FQDN, you need a @ sign to show a user.
Not sure even how you manage to do that in the first place as its no legit format.

If you go to edit users what the username look like

That’s not true.

A username has nothing to do with FQDNs and it can be what looks like a FQDN if you want it to. Periods are allowed in usernames on Linux.

OP has users created back before user@domain.tld was valid for some services.

You can copy the user.domain.tld user line in /etc/passwd and /etc/shadow and make it user@domain.tld, so you have both. That should work fine for all services, since the UID and home directory will be the same.

That’s how Virtualmin supported user@domain.tld usernames back before it was commonly possible in all services. I don’t think we do the double-user thing, anymore, since everything we use supports @ in usernames now.

You could also probably just change the user name to user@domain.tld, without making it a duplicate of the original name. I don’t think we store metadata that would make this not work. Maybe try it with one name and make sure Virtualmin is still able to see/edit it, and make sure you can still login, etc.

But, also, I’m unaware of any programs that won’t work with usernames like that. I know Thunderbird and Outlook could do so back before we changed the default format to user@domain.tld.

1 Like

Maybe I’m reading it wrong, I thought he saying the user is mail.domain.nl (thats a domain name not username) , maybe he means mail.domain.nl@mail.domain.nl

You’re reading it wrong, but mail.domain.com can absolutely be a username.

Apart from validity, it could certainly be quite confusing :rofl: