Use the get operation to retrieve status of Spam Filtering service, and Spam Filtering preferences for a specified user (Administrator or mailbox owner).
A request XML packet retrieving info on Spam Filtering service includes the get operation node:
<packet version="1.4.2.0">
<spamfilter>
<get>
...
</get>
</spamfilter>
</packet>
The get node is presented by the SpamFilterGetInputType type (spamfilter.xsd
), and its graphical representation is as follows:
spamfilter.xsd
).
Remarks
You can retrieve info on users specified by SpamAssassin ID, and users specified by e-mail address in a single packet. Add ID's of users specified by SpamAssassin ID to the filter node of the first get operation, and e-mail addresses of users specified by e-mail address (or string admin) to the filter node of the second get operation.
<get>
<filter>
...
</filter>
</get>
<get>
<filter>
...
</filter>
</get>
The get node of the output XML packet is presented by type SpamFilterGetOutputType (spamfilter.xsd
) and structured as follows:
common.xsd
).
The following nodes are nested in the response packet only if the operation succeeds:
spamfilter.xsd
).
This request packet retrieves configuration of Spam Filtering service for Administrator (server).
<packet>
<spamfilter>
<get>
<filter>
<username>admin</username>
</filter>
</get>
</spamfilter>
</packet>
Response:
<packet>
<spamfilter>
<get>
<result>
<status>ok</status>
<filter-id>admin</filter-id>
<id>1</id>
<username>admin</username>
<enabled/>
<preferences>
<personal>1</personal>
<max-children-process>5</max-children-process>
</preferences>
</result>
</get>
</spamfilter>
</packet>
If the SpamAssassin service was not found on the server, the response is as follows:
<packet>
<spamfilter>
<get>
<result>
<status>error</status>
<errcode>1026</errcode>
<errtext>Component is not installed.</errtext>
<filter-id>admin</filter-id>
</result>
</get>
</spamfilter>
</packet>
This request packet retrieves configuration of Spam Filtering service for mailboxes mybox@site.com and my@site.com.
<packet>
<spamfilter>
<get>
<filter>
<username>mybox@site.com</username>
<username>my@site.com</username>
</filter>
</get>
</spamfilter>
</packet>
Response:
<packet>
<spamfilter>
<get>
<result>
<status>ok</status>
<filter-id>mybox@site.com</filter-id>
<id>11</id>
<username>mybox@site.com</username>
<enabled/>
<preferences>
<rewrite-header>SPAM</rewrite-header>
</preferences>
</result>
<result>
<status>ok</status>
<filter-id>my@site.com</filter-id>
<id>12</id>
<username>my@site.com</username>
<disabled/>
<preferences>
<action>text</action>
</preferences>
</result>
</get>
</spamfilter>
</packet>