Page tree
Skip to end of metadata
Go to start of metadata

Description

This function saves Apache SpamAssassin's™ configuration information.

Warning:

cPanel API 1 is deprecated. We strongly recommend that you do not use cPanel API 1. However, no equivalent function exists in our newer APIs.

Examples


 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
$save_config = $cpanel->api1('SpamAssassin', 'saveconfig', array('blacklist_from1-user@example.com','blacklist_from2-auser@example.com '5', 'Spam_Rule 333', 'whitelist_from1-username@example.com', 'whitelist_from2-otherusername@example.com') ); // Call the function.

Note:

For more information, read our Guide to the LiveAPI System.

 LiveAPI Perl Module
my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
my $save_config = $cpliveapi->api1('SpamAssassin', 'saveconfig', ['blacklist_from1-user@example.com','blacklist_from2-auser@example.com '5', 'Spam_Rule 333', 'whitelist_from1-username@example.com', 'whitelist_from2-otherusername@example.com'] ); # Call the function.

Note:

For more information, read our Guide to the LiveAPI System.

 cPanel Tag System (deprecated)

Warning:

In cPanel & WHM version 11.30 and later, cPanel tags are deprecated. We provide this example to help developers move from the old cPanel tag system to our LiveAPI system. We strongly recommend that you only use the LiveAPI system to call the cPanel APIs.

<cpanel Module="SpamAssassin::saveconfig( $FORM('blacklist_from1', 'blacklist_from2','required_score','score', 'whitelist_from1', 'whitelist_from2') )">
 Command Line
cpapi1 --user=username SpamAssassin saveconfig user@example.com auser@example.com 5 "SPAM_RULE 3 3 3 3" username@example.com otherusername@example.com

Notes:

  • You must URI-encode these values.
  • username represents your account-level username.
  • For more information and additional output options, read our Guide to cPanel API 1 documentation or run the cpapi1 --help command. 
  • We introduced this functionality in cPanel & WHM version 56.

 Output (none)

This function does not return output.

Parameters

ParameterTypeDescriptionPossible valuesExample
blacklist_from-*string

Required

The email address or addresses to blacklist.

 

A valid email address.

Note:

Increment the values to specify more than one address. For example, blacklist_from1-user@example.com, blacklist_from2-auser@example.com

blacklist_from1-user@example.com
required_scoreinteger

Required

The score above which the server classifies an email message as spam.

An integer between 1 and 10. 5
score-*string

Required

Assign spam scores to individual spam rules.

 

A individual test score.

For more information about how to format spam rule scores, read our Apache SpamAssassin documentation.

SPAM_RULE 3 3 3 3
whitelist_fromstring

Required

The email address or addresses to whitelist.

 

A valid email address.

Note:

Increment the values to specify more than one address. For example, whitelist_from1-username@example.com, whitelist_from2-otherusername@example.com

whitelist_from1-username@example.com

Returns

This function does not return output.