Child pages
  • UAPI Functions - SpamAssassin::clear_spam_box

Versions Compared

Key

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

Description

Excerpt
This function clears the spam box of all its contents for all email accounts.


Warning
titleImportant:

This function deletes the Spam Box folder contents for every email address on the account, which includes the default account.


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/SpamAssassin/clear_spam_box

Include Page
LIB:_CallUAPIFromBrowserLink
LIB:_CallUAPIFromBrowserLink


Expand
titleLiveAPI PHP Class


Code Block
languagephp
linenumberstrue
$cpanel = new CPANEL(); // Connect to cPanel - only do this once.

// Clear the spam box for all email accounts.
$sa_settings = $cpanel->uapi(
    'SpamAssassin', 'clear_spam_box'
);

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.

# Clear the spam box for all email accounts.
my $sa_settings = $cpliveapi->uapi(
    'SpamAssassin', 'clear_spam_box'
);

Include Page
LIB:_LiveAPIPerlLink
LIB:_LiveAPIPerlLink


Expand
titleCommand Line


Code Block
languagebash
uapi --user=username SpamAssassin clear_spam_box

Include Page
LIB:_UAPICLINote
LIB:_UAPICLINote


Expand
titleOutput (JSON)


Code Block
languagebash
linenumberstrue
{
    "apiversion": 3,
    "module": "SpamAssassin",
    "func": "clear_spam_box",
    "result": {
        "data": null,
        "status": 1,
        "warnings": null,
        "errors": null,
        "metadata": {},
        "messages": [
            "Clearing Spam Box for main account. ... Done",
            "Clearing Spam Box for “user@example.com”. ... Done"
        ]
    }
}


Include Page
LIB:_cPanelAPIShellNote
LIB:_cPanelAPIShellNote


Parameters

This function does not accept any parameters.

Returns

This function only returns metadata.