Description

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


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


Examples




https://hostname.example.com:2083/cpsess##########/execute/SpamAssassin/clear_spam_box



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



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



uapi --user=username SpamAssassin clear_spam_box



{
    "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"
        ]
    }
}



Parameters

This function does not accept any parameters.

Returns

This function only returns metadata.