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.