• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

API :: Enable SpamAssassin for Email account

B

bmwbill42

Guest
Hello.. I have created the following function to enable the spam filter for an account:

function EnableSpam($Username, $DomainName)
{
$req = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?><packet version=\"1.3.4.1\"><spamfilter><set><filter><username>$Username@$DomainName</username></filter><enabled/></set></spamfilter>";
return $this->sendCommand($req);
}

$spam = rpc->EnableSpam(test,test.local);

print_r($spam);

The results of the function are:

Array ( [PACKET] => [SYSTEM] => [STATUS] => error [ERRCODE] => 1014 [ERRTEXT] => Parser error: Cannot parse the XML from the source specified )

After searching through the Plesk 8.4 API documentation I can't seem to find the correct way to enable the SpamAssassin feature on a selected mail account...
 
Back
Top