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

Description

This function disables the Apache SpamAssassin™ autodelete function.

Note:

To enable spam filtering, use the UAPI function Email::add_spam_filter.

Examples


 cPanel or Webmail Session URL
https://hostname.example.com:2083/cpsess##########/execute/Email/disable_spam_autodelete?account=username%40example.com


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.

// Disable spam autodelete for the account.
$disable_delete = $cpanel->uapi(
    'Email', 'disable_spam_autodelete',
    array(
        'account' => 'username@example.com',
         )
);


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.

# Disable spam autodelete for the account.
my $disable_delete = $cpliveapi->uapi(
    'Email', 'disable_spam_autodelete',
    {
        'account' => 'username@example.com',
    }
);


Note:

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

 

 cPanel Template Toolkit
<!-- Disable spam autodelete for the account. -->
[% execute('Email', 'disable_spam_autodelete', { 'account' => 'username@example.com' }) %]


Note:

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

 

 Command Line
uapi --user=username Email disable_spam_autodelete account=username%40example.com


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. 
  • If you run CloudLinux™, you must use the full path of the uapi command:

    /usr/local/cpanel/bin/uapi


 Output (JSON)
{
   "status" : 1,
   "errors" : null,
   "messages" : null,
   "data" : {
      "spam_auto_delete" : 0
   }
}


Note:

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

Parameters

ParameterTypeDescriptionPossible valuesExample
accountstring

The email account to disable the SpamAssassin autodelete function.

Notes:

  • If you do not specify this parameter, the system disables the SpamAssassin autodelete function globally.
  • We added this parameter in cPanel & WHM version 70.
A valid user email account.username@example.com

Returns

This function only returns metadata.