Use the get-allowed-preferences operation to retrieve Spam Filtering preferences available for a specified user (mailbox owner or Administrator). For information on Spam Filtering preferences available for a specified user, refer to the Spam Filtering Preferences section.
A request XML packet retrieving available Spam Filtering preferences includes the get-allowed-preferences operation node:
<packet version="1.4.2.0">
<spamfilter>
<get-allowed-preferences>
...
</get-allowed-preferences>
</spamfilter>
</packet>
The get-allowed-preferences node is presented by the SpamFilterGetAllowedPreferencesInputType 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-allowed-preferences operation, and e-mail addresses of users specified by e-mail address (or 'admin' string) to the filter node of the second get-allowed-preferences operation.
<get-allowed-preferences>
<filter>
...
</filter>
</get-allowed-preferences>
<get-allowed-preferences>
<filter>
...
</filter>
</get-allowed-preferences>
The get-allowed-preferences node of the output XML packet is presented by type SpamFilterGetAllowedPreferencesOutputType (spamfilter.xsd
) and structured as follows:
common.xsd
).Note: preferences are separated by the <preference> tag.
This request packet retrieves Spam Filtering service preferences available for Administrator.
<packet>
<spamfilter>
<get-allowed-preferences>
<filter>
<username>admin</username>
</filter>
</get-allowed-preferences>
</spamfilter>
</packet>
Response:
<packet>
<spamfilter>
<get-allowed-preferences>
<result>
<status>ok</status>
<filter-id>admin</filter-id>
<preference>personal</preference>
<preference>max-children-process</preference>
<preference>required-score</preference>
<preference>rewrite-header</preference>
</result>
</get-allowed-preferences>
</spamfilter>
</packet>
If the SpamAssassin service is restricted by Plesk licence key, or a user does not have access to SpamAssassin management, the response is as follows:
<packet>
<spamfilter>
<get-allowed-preferences>
<result>
<status>error</status>
<errcode>1006</errcode>
<errtext>Permission denied.</errtext>
<filter-id>admin</filter-id>
</result>
</get-allowed-preferences>
</spamfilter>
</packet>
This request packet retrieves Spam Filtering preferences available for mailbox mybox@site.com, and SpamAssassin user with ID 7.
<packet>
<spamfilter>
<get-allowed-preferences>
<filter>
<username>mybox@site.com</username>
</filter>
</get-allowed-preferences>
<get-allowed-preferences>
<filter>
<spamfilter-id>7</spamfilter-id>
</filter>
</get-allowed-preferences>
</spamfilter>
</packet>
Response:
<packet>
<spamfilter>
<get-allowed-preferences>
<result>
<status>ok</status>
<filter-id>mybox@site.com</filter-id>
<preference>personal</preference>
<preference>max-children-process</preference>
<preference>required-score</preference>
<preference>rewrite-header</preference>
</result>
</get-allowed-preferences>
<get-allowed-preferences>
<result>
<status>ok</status>
<filter-id>7</filter-id>
<preference>reject-spam</preference>
<preference>required-score</preference>
<preference>rewrite-header</preference>
</result>
</get-allowed-preferences>
</spamfilter>
</packet>
This request packet retrieves Spam Filtering preferences available for mailboxes mybox@site.com and my@site.com.
<packet>
<spamfilter>
<get-allowed-preferences>
<filter>
<username>mybox@site.com</username>
<username>my@site.com</username>
</filter>
</get-allowed-preferences>
</spamfilter>
</packet>
Response:
<packet>
<spamfilter>
<get-allowed-preferences>
<result>
<status>ok</status>
<filter-id>mybox@site.com</filter-id>
<preference>personal</preference>
<preference>max-children-process</preference>
<preference>required-score</preference>
<preference>rewrite-header</preference>
</result>
<result>
<status>ok</status>
<filter-id>my@site.com</filter-id>
<preference>reject-spam</preference>
<preference>required-score</preference>
<preference>rewrite-header</preference>
</result>
</get-allowed-preferences>
</spamfilter>
</packet>