UAPI Functions - Email::add_spam_filter

Description

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

Examples 


 cPanel or Webmail Session URL

https://hostname.example.com:2083/cpsess##########/execute/Email/add_spam_filter?required_score=8.0

 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',
         )
);

 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',
    }
);

 cPanel Template Toolkit

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

 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.

 Output (JSON)

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

 

Note:

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

 

Parameters

Parameter

Type

Description

Possible values

 Example 

 required_score 

 integer 

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 integer.

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 or10.0). 

8.0

 

Returns

This function only returns metadata.

 

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

The cPanel Interface

For  cPanel  &  WHM  version  58 Overview The cPanel interface is...

User Preferences

For cPanel & WHM version 58 Overview This document outlines how to access your cPanel...

Manage External Authentications

For cPanel & WHM version 58 Overview Manage credentials Additional documentation...

What is cPanelID?

In This Article:  Overview ServicesHow to get a cPanelID cPanelID External...

Guide to cPanel Interface Customization - cPanel Style Development

Introduction You can develop custom styles that modify the appearance of the cPanel interface....