I have a problem setting a user's e-mail Catch All. I use the following code:
I print_r'ed the $da_array and the contents are valid. I also printed the parameters the function receives, and they are valid too. Other api functions do work. I can set the catch all in directadmin itself.
Any ideas?
Floris
define(CATCHALL_FAIL, 0);
define(CATCHALL_BLACKHOLE, 1);
define(CATCHALL_ADDRESS, 2);
function _addcatchall($da_user, $domain, $type, $catch_address="") {
$da = new HTTPSocket;
$da->connect("ssl://" . $GLOBALS["config"]["server_ip"], 2222);
$da->set_login("admin|" . $da_user, $GLOBALS["config"]["da_admin_pass"]);
$da->set_method("POST");
switch($type) {
case CATCHALL_BLACKHOLE :
$da_array = array("domain" => $domain["name"], "catch" => ":blackhole:");
break;
case CATCHALL_ADDRESS :
$da_array = array("domain" => $domain["name"], "catch" => "address", "name" => $catch_address);
break;
default :
$da_array = array("domain" => $domain["name"], "catch" => ":fail:");
break;
}
$da->query("/CMD_API_EMAIL_CATCH_ALL", $da_array);
return $da->fetch_parsed_body();
}
I print_r'ed the $da_array and the contents are valid. I also printed the parameters the function receives, and they are valid too. Other api functions do work. I can set the catch all in directadmin itself.
Any ideas?
Floris
Last edited: