How to setup new subdomain for email management?

This operation can be carried out via the Virtualmin GUI. To redirect webmail.domain.tld to /roundcube folder:
Virtualmin → Services → Configure Website. Click Edit Directives, find the lines which say

RewriteCond %{HTTP_HOST} =webmail.domain.tld
RewriteRule ^(.*) https://domain.tld/20000/ [R]

Change domain.tld/20000/ to anything you want, e.g. domain.tld/roundcube/. You must restart the web server after this. You may also wish to do the same for Virtualmin → Services → Configure SSL Website.

Also see https://www.virtualmin.com/documentation/id%2Cwebmail_and_virtualmin

Yes, that’s the reason we admins install Webmin / Virtualmin, so that we can:

  • configure servers quickly and easily
  • avoid typos and mistakes that inevitably happen when doing things by hand
  • bring about standardization for setup and configuration across all systems
  • automate routine operations via the Virtualmin CLI
  • adhere to the best practices that we define and wish to follow