I am trying to create my own frontend to the SpamAssassin module on the cPanel. I want to be able to adjust the blacklist and whitelist, the score to mark an email as spam, and the option to delete the spam. I can see the functions in API1 but not in API2 or UAPI. This is the code so far -
This gives me the white list and black list after some PHP processing.
But I can't see how to get the CPANEL VARIABLES into a PHP variable.
Thanks for any help
Code:
<?php
/**
*
* Adjust SpamAssasin White list and Black list
*
**/
include(ABSPATH . "PHP/xmlapi.php");
$domain_username = "top secret";
$domain_password = "top secret";
$ip = "top secret";
$xmlapi = new xmlapi($ip);
$xmlapi->password_auth($domain_username,$domain_password); // logon to the API
$xmlapi->set_debug(0);
// Request the SpamAssassin config from
// the API1 functions (API1 call to SpamAssassin::config)
$result = $xmlapi->api1_query($domain_username, "SpamAssassin", "config", array(domain=>$domain) );
// PROCESS THE $result HTML data
// Request the Email Spam setting from
// the API1 functions (API1 call to Email::has_spam_autodelete)
$result = $xmlapi->api1_query($domain_username, "Email", "has_spam_autodelete", array(domain=>$domain) );
// NOW READ THE spam_auto_delete AND spam_auto_delete_score CPANEL VARIABLES
?>
But I can't see how to get the CPANEL VARIABLES into a PHP variable.
Thanks for any help
Last edited by a moderator: