This page lists many of the template variables that you can use in email messages to domain owners and mailboxes, initial website content, Apache and BIND configurations and many other places in Virtualmin.

In all cases, variables like ${DOM} or $DOM will be replaced with the value from the domain or mailbox being created. Additional variables can be found by looking in one of the /etc/webmin/virtual-server/domains files. The parameters found in those files can all be used in the template variables.

Domain template variables

These variables apply to virtual server templates:

$DOMDomain name, e.g.,
$IDNDOMDomain name in native character set, e.g., παράδειγμα.ευ
$USERVirtual server’s admin login and Unix username
$GROUPUnix group for mailboxes
$PASSPlain text password
$IPIP address for the virtual server
$OWNERVirtual server description
$EMAILTOContact email address
$HOMEHome directory
$IDUnique ID for each domain
$PARENTUnique ID for the parent domain, if any
$UIDUnix UID for the server’s Unix user
$GIDUnix GID for the server’s Unix group
$PREFIXPrefix/suffix for mailbox users
$QUOTAQuota for Unix user and all mailboxes
$UQUOTAQuota for Unix user only
$BW_LIMITMonthly bandwidth limit
$BW_USAGEBandwidth used this month
$RESELLERReseller’s login name, if any
$DBDefault database name
$MYSQL_USERUsername for MySQL login
$MYSQL_PASSPassword for MySQL login
$RESELLER_DESCReseller’s description
$DISABLEDList of disabled services
$DISABLED_WHYReason for virtual server being disabled

When the template is related to a sub-server, variables for the parent server are also available with PARENT_DOMAIN_ prefix, like $PARENT_DOMAIN_HOME and $PARENT_DOMAIN_DOM. Variables corresponding to the custom fields will use the format $VIRTUALSERVER_FIELD_fieldname with fieldname representing the custom field’s name.

Domain feature variables

The following variables are available in any virtual server related template, and will be set to 1 if the feature they are related to is enabled, 0 if not. They are most useful in blocks like ${IF-DNS} ... ${ENDIF-DNS}.

$DIRVirtual server has a home directory
$UNIXServer has a Unix login
$VIRTPrivate IP address is associated with virtual server
$WEBWebsite enabled
$MAILEmail for the domain is accepted
$SSLWebsite with SSL support enabled
$DNSDNS domain exists
$LOGROTATELog rotation for web/FTP logs enabled
$MYSQLServer has MySQL login/databases
$POSTGRESServer has PostgreSQL login
$WEBALIZERWeb traffic reporting by Webalizer
$FTPVirtual anonymous FTP site enabled
$SPAMSpam filtering for email enabled
$VIRUSVirus filtering enabled
$STATUSWebsite status monitoring active

Plugin feature-related variables:

$VIRTUALMIN-DAVDAV access to website
$VIRTUALMIN-SVNSVN access to repositories
$VIRTUALMIN-MAILMANMailing lists for the server
$VIRTUALMIN-AWSTATSAWstats web traffic reporting
$VIRTUALMIN-REGISTRARDNS domain registration
$VIRTUALMIN-MAILRELAYEmail relayed to another server
$VIRTUALMIN-INITCommands run at boot time

Mailbox variables

Variables for mailbox/FTP user templates:

$USERFull Unix username
$MAILBOXEmail address’ first part before @ sign
$PASSEncrypted password
$PLAINPASSPlain-text password
$QUOTADisk quota
$UQUOTADisk space used
$EMAILFull email address
$EXTRAAdditional email addresses
$HOMEHome directory
$REALReal name of the user
$SHELLUnix shell
$UIDMailbox Unix user’s UID
$GIDUnix user’s GID
$FTPSet to 1 if FTP access, 0 if not
$SSHSet to 1 if SSH access, 0 if not

Variables in domain modification scripts

If you’ve set up Virtualmin to execute a script before or after making modifications to a virtual server, all the variables mentioned on this page are accessible as Unix environment variables. However, they begin with VIRTUALSERVER_ prefix, such as $VIRTUALSERVER_DOM and any dashes are substituted with underscores.

For details and examples, see Domain Management API page.