Description

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


Examples 




https://hostname.example.com:2083/cpsess##########/execute/Email/add_spam_filter?required_score=8.0&account=username%40example.com



$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',
		'account'			=> 'username@example.com',
         )
);

 



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',
		'account'			=> 'username@example.com',
    }
);

 



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

 



uapi --user=username Email add_spam_filter required_score=8.0 account=username%40example.com



{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": null,
  "metadata": {
    "transformed": 1
  }
}



Parameters

ParameterTypeDescriptionPossible valuesExample
required_scorestring

Set a spam score threshold value.

  • You must specify a value greater than 0 , and lower than the domain owner's spam score threshold value.
  • In cPanel & WHM version 70 and later, you cannot enter 0 as a value for this parameter.
  • You can retrieve the domain owner‘s spam score threshold value via the  cpuser_spam_auto_delete_score  return from the UAPI  Email::get_spam_settings function .

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

A positive integer.

  • The default value, 5, is an aggressive spam score.
  • The lower the spam score, the more likely that Apache SpamAssassin will label messages as spam and delete them.
  • Some systems may wish to use a more lenient spam score (for example, 8 or 10). 


8
accountstring

The email account to apply a spam score threshold value.

We added this parameter in cPanel & WHM version 70.

If you do not specify a value, the function applies the new spam score threshold value to all accounts.

A valid user email account.username@example.com

Returns

This function only returns metadata.