Child pages
  • UAPI Functions - Email::add_spam_filter

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Description

Excerpt

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


Note
titleNotes:

Multiexcerpt include
SpaceWithExcerptcom.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@12665
MultiExcerptNameAPIDisabledSpamFilterRole
PageWithExcerptLIB:_ServerRoleDisabledAPI

Panel
bgColor#F2F2F2
borderStylenone

Examples 


Panel
bgColor#FFFFFF
borderStylenone


Expand
titlecPanel or Webmail Session URL


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

Include Page
LIB:_CallUAPIFromBrowserLink
LIB:_CallUAPIFromBrowserLink


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$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',
         )
);

Include Page
LIB:_LiveAPIPHPLink
LIB:_LiveAPIPHPLink

 


Expand
titleLiveAPI Perl Module


Code Block
languageperl
linenumberstrue
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',
    }
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink

 


Expand
titlecPanel Template Toolkit


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

Include Page
LIB:_TTLink
LIB:_TTLink

 


Expand
titleCommand Line


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

Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote


Expand
titleOutput (JSON)


Code Block
languagetext
linenumberstrue
{
  "messages": null,
  "errors": null,
  "status": 1,
  "data": null,
  "metadata": {
    "transformed": 1
  }
}


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


Parameters

ParameterTypeDescriptionPossible valuesExample
required_scorestring

Set a spam score threshold value.

Note
titleNotes:
  • 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.

Note
titleNotes:
  • 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.

Note
titleNote:

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.