How can I create "Email only" users with virtualmin create-user?

I am testing the logistics of using Virtualmin for a multi-domain email server. With a (more or less) out of the box Virtuamin install if I run:

virtualmin create-user --domain test-domain.com --user test-user --password Something

The resulting user has Email, FTP, and SSH.

I can change this to “Email only” via the GUI, but I cannot seem to figure out how to do it via the command line.

For example adding --ftp gives it Email and FTP (and drops SSH), adding --noemail gives FTP and SSH, but no obvious option eliminates those two and gives me just Email like the GUI.

Is this possible?

SYSTEM INFORMATION
OS type and version Ubuntu 24.04
Virtualmin version 7.10.0

I found a work-around (I haven’t tested if the mail works yet, but it does result in an “Email only” user showing up in the GUI so confidence is high) by adding --shell /dev/null to the command as:

virtualmin create-user --domain test-domain.com --user test-user --password Something --shell /dev/null

Is that “the way” to do this? Even if it works it seems a little strange in that the help says:

virtualmin create-user
No domain specified

Adds a new mailbox user to an existing Virtualmin domain.

virtualmin create-user --domain domain.name
–user new-username
–pass “password-for-new-user” |
(et cetera)

But that is not really what it does, at least in my out-of-the-box install it creates an Email, FTP, SSH user and offers no “–emailonly” flag… and so is the kind of esoteric little tidbit that Virtualmin is generally so good at helping to remove from the Linux hosting environment.

If this is “the way” may I suggest, if not an “–emailonly” flag or (really) email-only becoming the default (since the only description line in the help suggests that that is all it will do without extra flags) then could the help page be altered to say “Creates a new Email, SSH, FTP” user and add some examples at the bottom including one described as “for email only” with the --shell /dev/null bit?

Thanks.

The doc say you need a flag for ftp, user should be email only.

but running the command as per docs the ftp and ssh permission are set.
Is this a bug or incorrect documentation.

This is a bug, see Creating a user via CLI without FTP or SSH access · Issue #786 · virtualmin/virtualmin-gpl · GitHub

the --shell is the workaround.

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