cPanel/SpamAssassin
cPanel module

SpamAssassin

4 functions, invoked through the cpanel_uapi tool.

scope cpanel:uapi
Call any function with cpanel_uapi(service_id, module="SpamAssassin", function, params). Live availability depends on the cPanel features JetHost has enabled on your account — call list_cpanel_operations to see what is active.

clear_spam_box GET#

Delete spam box contents

This function clears the spam box of all its contents for all email accounts.

Important:

This function deletes the Spam Box folder contents for every email address on the account, which includes the system user email account.

No parameters.

get_symbolic_test_names GET#

Return SpamAssassin™ symbolic test scores

This function lists the Apache SpamAssassin™ scores for each symbolic test.

No parameters.

Response — normalized as { ok, data, errors[], warnings[] }; data is an array of:

keystring
The name of the test.
rule_typestring
The type and section of the email that the SpamAssassin analyses. body_tests full_evals head_evals head_tests meta_tests other_tests rawbody_tests uri_tests
One of: body_tests full_evals head_evals head_tests meta_tests other_tests rawbody_tests uri_tests
scoreany
The score to assign to the email if the result of the test is true.

get_user_preferences GET#

Return SpamAssassin™ settings

This function lists the Apache SpamAssassin™ settings for the account.

Note:

Additional customizations may appear in the returns. Form more information read the Apache SpamAssassin™ configuration file documentation.

No parameters.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

blacklist_fromarray<string>
The email addresses on the blacklist.
required_scorearray<number>
The score to mark a message as spam. The system considers mail that matches this score to be spam.
scorearray<string>
The symbolic test name and score.
whitelist_fromarray<string>
The email addresses on the whitelist.

update_user_preference GET#

Update SpamAssassin™ settings

This function sets the Apache SpamAssassin™ settings for the account.

Note:

Additional customizations may appear in the function's return. For more information, read the Apache SpamAssassin configuration file documentation.

preferencestringRequired
The variable that you want to manipulate. score required_score whitelist_from blacklist_from A custom SpamAssassin variable. Important: You can only choose one of these possible values per call. * If you enter a value for the preference parameter, but you do not define a value for the value parameter, the function will remove any previous settings.
valuestringOptional
The value for the preference of the variable that you want to manipulate. A valid SpamAssassin "TEST_NAME SCORE" value when the value of the preference parameter is score, where: TEST_NAME represents the symbolic name of the test. For list of symbolic test names, run the UAPI SpamAssassin::get_symbolic_test_names function. SCORE represents the floating-point value that SpamAssassin assigns to the mail when the test result is true. The score value must be greater than 0, and less than 1000. A valid floating-point number if the value of the preference parameter is required_score. A valid email address if the value of the preference parameter is whitelist_from or blacklist_from. A custom SpamAssassin variable value. Note: To enter multiple values, increment the parameter name. For example, use the value-0 and value-1 parameters.

Response — normalized as { ok, data, errors[], warnings[] }; data contains:

additionalPropertiesany
An array containing custom SpamAssassin variable values. Note: The array's name is the custom SpamAssassin variable's name.
blacklist_fromarray<string>
An array of email addresses on the blacklist.
required_scorearray<number>
An array containing the score at which the system will mark a message as spam. The system considers mail that matches this score to be spam.
scorearray<string>
An array of the symbolic test names and their scores.
whitelist_fromarray<string>
An array of the email addresses on the whitelist.