Mail Account Settings
Mail account settings are specified by complex type mailnameType (plesk_mailname.xsd). It is structured as follows:

- The id node is optional. It specifies the identifier of the mail user (if this user already exists in Plesk database). Data type: integer.
- The name node is required. It specifies the name of the mail user. Data type: string.
- The cp_access node is optional. It specifies a collection of Plesk GUI settings for the mail user. Data type: none. See the structure of this node in the Control Panel Settings section.
- The mailbox node is optional. It specifies a collection of mail box settings. Data type: none. See the structure of this node in the Mail Box Settings section.
- The mailbox-usage node is optional. It specifies the amount of disk space used by a mail box. Data type: long.
Note: This node is supported in API RPC 1.5.2.0 and later versions.
- The redirect node is optional. It enables the redirect feature for the mail account and specifies the email address where the correspondence will be redirected. Data type: none. See the structure of this node in the Redirect Settings section.
- The mailgroup node is optional. It defines the list of mail addresses for which the mail account will serve as a mail group. This feature implements redirecting mail to multiple addresses. Data type: none. See the structure of this node in the Mail Group Settings section.
- The group node is optional. It specifies a mail group in which the given mail account has a membership. Data type: string.
- The alias node is optional. It specifies an alternative name for the given mail name (e.g., the bob alias set for bfisher@example.com means that all mail sent to bob@example.com and to the original address will get to the same mail box). Data type: string.
- The autoresponders node is optional. It defines a collection of automatic response messages and their settings that will be sent from the given mail account. Data type: none. See the structure of this node in the Automatic response settings section.
- The repository node is optional. It contains a list of files stored in the repository of the given mail account. These files can be attached to automatic response messages if necessary. Data type: none. See the structure of this node in the Repository Settings section.
- The password node is optional. It specifies the password used by mail user to access the mail box. Data type: string.
- The password_type node is optional. It specifies the type of the password. Data type: string. Allowed values: plain | crypt.
- The antivir node is optional. It specifies the antivirus protection settings for the incoming/outgoing correspondence. Data type: string. Allowed values: off | inout | in | out. This node is renamed to antivir in API RPC 1.4.2.0. In the earlier versions of API RPC, it is called drweb.
- The permissions node is optional. It specifies a collection of mail user permissions. Data type: MailUserPermission (
plesk_mailname.xsd). This node is supported in API RPC 1.4.2.0 and later. See the structure of this node in the Mail User Permissions section.
The following sample packet creates a mail account and sets a collection of settings for it:
<packet version="1.4.2.0">
<mail>
<create>
<filter>
<domain_id>12</domain_id>
<mailname>
<name>bfischer</name>
<cp_access>
<enabled>true</enabled>
</cp_access>
<mailbox>
<enabled>true</enabled>
<quota>10485760</quota>
</mailbox>
<alias>bob</alias>
<antivir>true</antivir>
<permissions>
<cp_access>true</cp_access>
<manage_drweb>true</manage_drweb>
<manage_spamfilter>true</manage_spamfilter>
</permissions>
</mailname>
</filter>
</create>
</mail>
</packet>