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

 

Description

This function sets a new minimum Apache SpamAssassin™ spam score.

Note:

For more information, read our Apache SpamAssassin documentation. 

Examples 


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Email/add_spam_filter?required_score=8.0

Note:

This example calls the UAPI function via a cPanel session. For more information, read our Guide to UAPI documentation. 

 LiveAPI PHP Class
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Change the cPanel account's minimum spam score to 8.
$new_spam_score = $cpanel->uapi(
    'Email', 'add_spam_filter',
    array(
        'required_score'     => '8.0',
         )
);

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.
 
# Change the cPanel account's minimum spam score to 8.
my $new_spam_score = $cpliveapi->uapi(
    'Email', 'add_spam_filter',
    {
        'required_score'     => '8.0',
    }
);

Note:

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

 

 cPanel Template Toolkit
<!-- Change the cPanel account's minimum spam score to 8. -->
[% execute('Email', 'add_spam_filter', { 'required_score' => '8.0' }) %]

Note:

For more information, read our Guide to Template Toolkit documentation. 

 

 Command Line
uapi --user=username Email add_spam_filter required_score=8.0

Notes:

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

 Output (JSON)
{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": null,
  "metadata": {
    "transformed": 1
  }
}

Note:

Use cPanel's API Shell interface (cPanel >> Home >> Advanced >> API Shell) to directly test cPanel API calls.

   

Parameters

ParameterTypeDescriptionPossible valuesExample
required_scorestring

The new minimum spam score.

If you do not specify a value, the function resets the spam score to the default value (5.0).

A positive number.

Note:

The default value, 5.0, is an aggressive spam score.

The lower the spam score, the more likely that Apache SpamAssassin will label messages as spam.

Some systems may wish to use a more lenient spam score (for example, 8.0 or 10.0). 

8.0

Returns

This function only returns metadata.