Use the get-patterns operation to retrieve patterns from a specified list of a specified user (Administrator or mailbox owner).
Request Packet Structure
A request XML packet retrieving a pattern includes the get-patterns operation node:
The get-patterns node is presented by the SpamFilterGetPatternsInputType type (
spamfilter.xsd), and its graphical representation is as follows:
- The filter node is optional. It specifies the filtering rule. Data type: SpamassassinFilterType (
- 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.
You can retrieve multiple lists for users specified by different filtering rules in a single packet. Add as many get-patterns operations as the number of different filtering rules to be applied.
Important: When creating request packets, put nodes and elements in the order they follow in the packet structure.
Response Packet Structure
The get-patterns node of the output XML packet is presented by type SpamFilterGetPatternsOutputType (
spamfilter.xsd) and structured as follows:
- The result node is required. It wraps the response retrieved from the server. Data type: ResultFilterType (
- The status node is required. It specifies the execution status of the get-patterns operation. Data type: string. Allowed values: ok | error.
- The errcode node is optional. Is returns the error code if the get-patterns operation fails. Data type: integer.
- The errtext node is optional. It returns the error message if the get-patterns 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: anySimpleType.
- The id node is optional. It returns the ID of the Spamassassin user, if the operation succeeds. Data type: integer.
- The pattern node is optional. It holds a pattern of the specified list. Data type: string.
If a list contains more than one pattern, the set of patterns will look as follows: <pattern>...</pattern>...<pattern>...</pattern>. For more information, refer to the Response Samples section.
Retrieving patterns from a single list
This request packet retrieves patterns from server white list.
Retrieving patterns from multiple lists
This request packet retrieves patterns from unwhite list of mailboxes email@example.com and firstname.lastname@example.org.
Response (if user email@example.com was not found on the server):