Removing Pattern
Use the del-pattern operation to remove patterns from a specified list of a specified user (Administrator or mailbox owner). For information on patterns refer to the Defining Pattern section.
Request Packet Structure
A request XML packet removing a pattern includes the del-pattern operation node:
<packet>
<spamfilter>
<del-pattern>
...
</del-pattern>
</spamfilter>
</packet>
The del-pattern node is presented by the
SpamFilterDelPatternInputType type (spamfilter.xsd
), and its
graphical representation is as follows:
Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.
- The filter node is required. It specifies the filtering rule.
Data type: SpamPatternFilter (
spamfilter.xsd
). - The list node is required. It specifies the type of the list.
For information on list types, refer to the Types of Server
Lists and Types of Lists available for Mailbox
Owners sections. Data type: SpamListType
(
spamfilter.xsd
). Allowed values: black | white | unblack | unwhite. - The username node is required.It specifies the name of a SpamAssassin user. You can specify e-mail address of a mailbox owner, or the admin value. To access server black (white) lists , you should set admin as a value for this node. Data type: string.
- The spamfilter-id node is required. It specifies the ID of a SpamAssassin user. Data type: integer.
Remarks
You can remove patterns from multiple users in a single packet. Add as many del-pattern operations as the number of different users to be affected.
<del-pattern>
...
</del-pattern>
...
<del-pattern>
...
</del-pattern>
Note: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The del-pattern node of the output XML packet is presented by type
SpamFilterDelPatternOutputType (spamfilter.xsd
) and structured as
follows:
Note: The interactive schema navigator for all request packets is available here: http://plesk.github.io/api-schemas/1.6.8.0/agent_input.svg.
- The result node is required. It wraps the response retrieved
from the server. Data type: ResultFilterType (
common.xsd
). - The status node is required. It specifies the execution status of the del-pattern operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. Is returns the error code if the del-pattern operation fails. Data type: integer.
- The errtext node is optional. It returns the error message if the del-pattern operation fails. Data type: string.
- The filter-id node is optional. It holds the filtering rule parameter. For information, refer to the Available Filters section. Data type: anySimple.
- The id node is optional. It returns the ID of the removed pattern if the operation succeeds. Data type: integer.
Samples
Removing a pattern
This packet removes pattern *@spam.net from the server black list.
<packet>
<spamfilter>
<del-pattern>
<filter>
<pattern>*@spam.net</pattern>
</filter>
<list>black</list>
<username>admin</username>
</del-pattern>
</spamfilter>
</packet>
Removing multiple patterns
This packet removes patterns *@spam.net and spam@mailme.net from the black list of mailbox mybox@site.com.
<packet>
<spamfilter>
<del-pattern>
<filter>
<pattern>*@spam.net</pattern>
<pattern>spam@mailme.net</pattern>
</filter>
<list>black</list>
<username>mybox@site.com</username>
</del-pattern>
</spamfilter>
</packet>
This packet removes patterns *@spam.net and spam@mailme.net from the black list of mailbox mybox@site.com, and from server black list.
<packet>
<spamfilter>
<del-pattern>
<filter>
<pattern>*@spam.net</pattern>
<pattern>spam@mailme.net</pattern>
</filter>
<list>black</list>
<username>mybox@site.com</username>
</del-pattern>
<del-pattern>
<filter>
<pattern>*@spam.net</pattern>
<pattern>spam@mailme.net</pattern>
</filter>
<list>black</list>
<username>admin</username>
</del-pattern>
</spamfilter>
</packet>