XML API: Adding & Removing Filters
When using the API1 function, addfilter, the newly created filter can be viewed with the API2 function, listfilters, but for some reason do not appear in cPanel itself. Furthermore, there seems no way to delete these filters, either with the API1 function delfilter or the API2 function deletefilter. This is how it is created:
And these were the attempts to remove it:
What have I done wrong? :confused:
$args = array($sEmail, "contains", "header_to", "Discard");
$xmlapi->api1_query($account, "Email", "addfilter", $args);And these were the attempts to remove it:
$args = array($sEmail, "Discard");
$xmlapi->api1_query($account, "Email", "delfilter", $args);$params = array('account'=>$sEmail, 'filtername'=>"$header_to contains 'me@domain.com'",);
$xmlapi->api2_query($account, "Email", "deletefilter", $params);What have I done wrong? :confused:
-
The reason why it was not working is because the addfilter function adds old-style filters, which are not recognized by my host. I simply deleted the .filter file, and used the new storefilter function instead, which works well in conjunction with deletefilter. Hope it may be of help to others. ;) 0
Please sign in to leave a comment.
Comments
1 comment