Creating domain templates for different Plesk users
To create a domain template for a certain Plesk Client, specify this client either by id, or by login (both are unique in Plesk).
<packet version="1.4.1.0">
<domain-template>
<add>
<name>base_template</name>
<client-id>12</client-id>
<mail>
<webmail>true</webmail>
</mail>
</add>
</domain-template>
</packet>
Or:
<packet version="1.4.1.0">
<domain-template>
<add>
<name>base_template</name>
<client-login>technolux</client-login>
<mail>
<webmail>true</webmail>
</mail>
</add>
</domain-template>
</packet>
When creating a domain template for Plesk Administrator, nodes <client-id> and <client-login> are not used:
<packet version="1.4.1.0">
<domain-template>
<add>
<name>base_template</name>
<mail>
<webmail>true</webmail>
</mail>
</add>
</domain-template>
</packet>
Creating multiple domain templates
To create two domain templates with a single packet, include two different <add> blocks:
<packet version="1.4.1.0">
<domain-template>
<add>
<name>base_template</name>
<mail>
<webmail>true</webmail>
</mail>
</add>
<add>
<name>quick_template</name>
<mail>
<webmail>false</webmail>
</mail>
</add>
</domain-template>
</packet>
Mailing settings
The following packet creates three domain templates. The mailing settings are as follows:
<packet version="1.4.1.0">
<domain-template>
<add>
<name>bounce_template</name>
<mail>
<webmail>true</webmail>
<nonexistent-user>
<bounce>Email address does not exist.</bounce>
</nonexistent-user>
</mail>
</add>
<add>
<name>forward_template</name>
<mail>
<nonexistent-user>
<forward>spam@technolux.co.uk</forward>
</nonexistent-user>
</mail>
</add>
<add>
<name>reject_template</name>
<mail>
<nonexistent-user>
<reject/>
</nonexistent-user>
</mail>
</add>
</domain-template>
</packet>
Log rotation
To disable log rotation on a domain created using the specified template, use the following packet:
<packet version="1.4.1.0">
<domain-template>
<add>
<name>base_template</name>
<log-rotation>
<off/>
</log-rotation>
</add>
</domain-template>
</packet>
The following packet creates the domain template that enables log rotation on a domain, allows the storage of up to 30 handled log files related to this domain, and removes active log files related to this domain from logging once a week:
<packet version="1.4.1.0">
<domain-template>
<add>
<name>base_template</name>
<log-rotation>
<on>
<log-condition>
<log-bytime>weekly</log-bytime>
</log-condition>
<log-max-num-files>30</log-max-num-files>
<log-compress>true</log-compress>
</on>
</log-rotation>
</add>
</domain-template>
</packet>
Preferences
The following packet creates a domain template and specifies preferences for domains created on its basis.
<packet version="1.4.1.0">
<domain-template>
<add>
<name>base_template</name>
<preferences>
<stat>6</stat>
<maillists>true</maillists>
<dns_zone_type>master</dns_zone_type>
</preferences>
</add>
</domain-template>
</packet>
Hosting
Here is the sample packet that creates a domain template and specifies physical hosting settings for domains that will be created using this domain template.
<packet version="1.4.1.0">
<domain-template>
<add>
<name>base_template</name>
<hosting>
<ftp_quota>100</ftp_quota>
<ssl>true</ssl>
<php>true</php>
<php_safe_mode>true</php_safe_mode>
<ssi>true</ssi>
<cgi>true</cgi>
<mod_perl>true</mod_perl>
<mod_python>true</mod_python>
<webstat>webalizer</webstat>
<errdocs>true</errdocs>
</hosting>
</add>
</domain-template>
</packet>