Make changes to Virtualmin via command-line

Is there any way I can make the following changes in Virtualmin via a command-line command?

Server Templates --> Mail for domain --> Format for usernames that include domain --> USENAME@DOMAIN
Module Config --> Defaults for new domains --> Domain name style in username --> FULL DOMAIN NAME

If made a little installation and customization script for Virtualmin…if I can find a command-line command for these changes, I don’t have to login to Virtualmin to do them manually :slight_smile:


Check out the list-template, get-template, and modify-template features.

They should allow you to do what you’re after – the trick is just figuring out which parameter it is you need to change :slight_smile: But you should be able to see them when you run “virtualmin get-template” with your template id.


Hi Andreycheck,

Thanks for the quick reply! After making this post I was heading in the right direction only couldn’t find out what the name was of the setting I wanted to change with the “virtualmin modify-template” command. The “get-template” tip helped me find it.

So to change from username.domain style to username@domain style in the Default Template, use the following command:

virtualmin modify-template --id 0 --setting append_style --value 6

I only can’t find how to change the option in “Module Config” since that isn’t a setting of a template…any ideas? :slight_smile:

I found the remaining setting. It’s located in /etc/webmin/virtual-server/config, the setting name is “longname”…I only can’t find a way to change it via command-line…

Well yeah…didn’t find a solution, but an “okay” workaround :slight_smile:

cp /etc/webmin/virtual-server/config /etc/webmin/virtual-server/config.default

perl -pi -e ‘s/longname=.*/longname=1/’ /etc/webmin/virtual-server/config (where longname is changed in value 1)

It’s a “one time only” change, so I can live with this workaound for now :wink:

Yeah, if you don’t see a way to do it on the command line, you may need to file a feature request so Jamie can make that available :slight_smile:


I just edited my post, I think you missed the “update”. Issue solved with a workaound, but it would be great if Jamie could make this available as a CLI feature" :slight_smile: