The remove operation is used to remove one to many mail accounts at one stroke, provided all these accounts refer to the same site. Plesk Administrator can remove any mail account registered in Plesk, while a Plesk customer can delete mail accounts referring to sites that belong to this Plesk customer only.
A request XML packet that deletes mail accounts should include the remove operation node:
<packet>
<mail>
<remove>
...
</remove>
</mail>
</packet>
The remove node does not have a separate type, it is nested within the MailTypeRequest type (mail_input.xsd
). The remove node has the following graphics representation:
mail_input.xsd
).
Remarks
To remove all mail accounts existing on a site, include to your request packet filter rule containing only site-id node.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
The remove node of the response packet is structured as follows:
common.xsd
).mail_output.xsd
).The following packet deletes a mail account:
<packet version="1.6.3.0">
<mail>
<remove>
<filter>
<site-id>1</site-id>
<name>techdept</name>
</filter>
</remove>
</mail>
</packet>
Response:
<?xml version="1.0" encoding="UTF-8"?>
<packet version="1.6.3.0">
<mail>
<remove>
<result>
<status>ok</status>
<mailname>
<name>techdept</name>
</mailname>
</result>
</remove>
</mail>
</packet>
To delete several mail accounts belonging to different sites, use multiple remove sections:
<packet version="1.6.3.0">
<mail>
<remove>
<filter>
<site-id>12</site-id>
<name>techdept</name>
<name>techknowledge</name>
</filter>
</remove>
<remove>
<filter>
<site-id>13</site-id>
<name>findept</name>
<name>proddept</name>
</filter>
</remove>
</mail>
</packet>
To delete all mail accounts from the specified site, the following packet can be used:
<packet version="1.6.3.0">
<mail>
<remove>
<filter>
<site-id>12</site-id>
</filter>
</remove>
</mail>
</packet>