Why an virtualmin email user cant consist of only numbers?

SYSTEM INFORMATION
OS type and version Debian 11
Webmin version 2.021
Virtualmin version 7.5
Related packages SUGGESTED

Why in Virtualmin cannot be created an email user consisting only numbers in his name ?
According to RFC 5322, which is the Internet Message Format standard, email usernames consisting only of numbers are allowed by this standard.

All-numeric usernames in Red Hat Enterprise Linux - Red Hat Customer Portal.

Usernames may contain only lower and upper case letters, digits, underscores, or dashes. They can end with a dollar sign. Dashes are not allowed at the beginning of the username. Fully numeric usernames and usernames . or … are also disallowed. It is not recommended to use
usernames beginning with . character as their home directories will be hidden in the ls output. In regular expression terms: [a-zA-Z0-9_.][a-zA-Z0-9_.-]*[$]?

2 Likes

So this is a rule imposed by Red Hat overriding an officially accepted standard for emails? Should that regex be applied more globally as most email format checks just use the standard? or is that just “tail wagging the dog”

I think its a linux issue

The OS having the issue is Debian

2 Likes

There is no rule saying you have to use system accounts for email. It’s just ‘built in’. I’m not gonna bother checking but I’m pretty sure you could set up an LDAP backend for Postfix and Dovecot.

interesting thought virtualmin allows you to create an email user like :grinning:@domain.com however dovecot doesn’t like this type of email so perhaps there is an issue there ?
you end up with this
image
maybe virtualmin should not allow you to create users that a mail server can not handle
@staff

Red Hat isn’t doing anything.

You can’t have a username starting with a number. Virtualmin mailbox users are system users. That is a choice we made almost two decades ago: everything is a system user. A domain is a system user, a mail user is a system user. This was so users could edit websites, have their own procmail recipes, have their own cronjobs, have a file manager, use various other tools that rely on having a home directory and a system user, etc.

Nobody is imposing limitations. It’s an implementation detail that comes from the reality of using Linux system users for everything.

There are arguments for putting mail users in a database or directory server. We used to have support for one such implementation but the services backing that stopped being maintained over a decade ago, so we removed it. We also support users in LDAP, those are subject to the same rules because they’re still system users, they just pull their metadata from the directory server…there are ways to do it differently, but we don’t do that. In Virtualmin mail users are Linux system users.

You could implement a new such system, where mail users are stored in a database or something else, and do not have Linux system users associated with them. But, that is not currently a thing we support.

We didn’t set out to build a mass-email hosting platform. We wanted full-featured users with all sorts of capabilities on the system. There are arguments that we shouldn’t have done it that way. But, it’s where we are.

It is very likely we will eventually have to divorce users (of all types, not just email) from system users. But, that is not today’s reality. If you want an all-numbers email address it’ll have to be an alias to a user that follows Linux rules for a system user.

1 Like

That is interesting, and probably a thing we ought to protect against.

What happens when you try to use Dovecot for this user’s mailbox? What are the errors?

I kinda doubt Unicode is legal in an email address, though, so maybe we should just exclude it. I dunno, I’d have to read up on the problem.

I just fails to auth …

Apr 20 06:00:39 server dovecot: imap-login: Disconnected (auth failed, 1 attempts in 2 secs): user=<😀@noideersoftware.co.uk>, method=PLAIN, rip=127.0.0.1, lip=127.0.0.1, secured, session=<nYnma735QNV/AAAB>

and of course usermin goes into fits

Define “fits”? I would actually expect Usermin to work. If Dovecot chokes on it, obviously you can’t retrieve mail via Dovecot, but Usermin can access local mail directly on the filesystem, if configured to do so. I kinda think it’d work? (Though I doubt you can actually receive mail with that username.)

Of course I would not if the user can not auth … the framework ui loads and a spinner sits there on the right panel

This topic was automatically closed 8 days after the last reply. New replies are no longer allowed.