Mail user account can be created on the specified site. To register new mail account in Plesk database, it is enough to specify some general setup information, namely: the site ID where the mail account will be registered, and the mail account name.
In addition, you can specify various mail account settings (all of them are optional):
- Mail user access to the account through Plesk GUI
- Mail box size
- Mail box alias
- Mail user permissions
- Antivirus protection
- Mail group members (if the account acts as a mail group)
- Mail groups in which the mail account has membership
- Files to store in the repository
- Automatic response messages
- Mail addresses to which all incoming correspondence will be redirected automatically
A mail account can have all these settings specified, or it can hold just some of them. You can specify these settings when creating a mail account or later (they can be set using the set_prefs operation).
Request Packet Structure
A request XML packet creating a mail account in Plesk database includes the create operation node:
The create node does not have a separate type, it is nested within the MailTypeRequest type (
mail_input.xsd). The create node has the following graphics representation:
- The filter node is required. It holds a collection of data describing mail accounts to be created. Data type: mailnameFilterType (
- The site-id node is required. It uniquely identifies the site on which the mail account will be created. Data type: integer.
- The mailname node is required. It defines the name of a mail account, and a collection of mail account settings (if any specified). Data type: mailnameAddType (
plesk_mailname.xsd). See the structure of this node in the Mail Account Settings section.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The create node of the response packet is structured as follows:
- The result node is required. It wraps the result of the requested create operation. Data type: operationresultType (
- The status node is required. It returns the execution status of the create operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. It returns an error code when the create operation fails. Data type: unsignedInt.
- The errtext node is optional. It returns an error message if the create operation fails. Data type: string.
- The mailname node is optional. It is required if the create operation succeeds. Returns a collection of settings set for the mail account that has just been created. Data type: mailnameType (
plesk_mailname.xsd). To see the structure of this node, refer to the Mail User Account Settings section.
The following packet creates two mail accounts on a single site:
To create multiple mail accounts on different sites within one packet, use multiple create nodes: