php - ISPConfig Bulk Mail add with SOAP fails with domain does not exists although it does exist -
i tried adding mailadresses saved in txt file, 1 per line, following code
<?php require 'soap_config.php'; $datei = "address.txt"; // name der datei $adresse = file($datei); // datei in ein array einlesen $client = new soapclient(null, array('location' => $soap_location, 'uri' => $soap_uri, 'trace' => 1, 'exceptions' => 1)); try { if($session_id = $client->login($username, $password)) { echo 'logged successfull. session id:'.$session_id.'<br />'; } foreach ($adresse $zeile) { //* set function parameters. $client_id = 1; $params = array( 'server_id' => 1, 'email' => $zeile, 'login' => $zeile, 'password' => 'password1!', 'name' => $zeile, 'uid' => 5000, 'gid' => 5000, 'maildir' => '/var/vmail/domain.tld/'.$zeile, 'quota' => 268435456, 'cc' => '', 'homedir' => '/var/vmail', 'autoresponder' => 'n', 'autoresponder_start_date' => array('day' => 1, 'month' => 7, 'year' => 2012, 'hour' => 0, 'minute' => 0), 'autoresponder_end_date' => array('day' => 20, 'month' => 7, 'year' => 2012, 'hour' => 0, 'minute' => 0), 'autoresponder_text' => 'hallo', 'move_junk' => 'y', 'custom_mailfilter' => '', 'postfix' => 'y', 'access' => 'n', 'disableimap' => 'n', 'disablepop3' => 'y', 'disabledeliver' => 'n', 'disablesmtp' => 'n' ); $affected_rows = $client->mail_user_add($session_id, $client_id, $params); echo "new user: ".$affected_rows."<br>"; } if($client->logout($session_id)) { echo 'logged out.<br />'; } } catch (soapfault $e) { echo $client->__getlastresponse(); die('soap error: '.$e->getmessage()); }; ?>
if run code following error
logged successfull. session id:83f678adsafa9f37b5qw47rrf73c3a97<br /><?xml version="1.0" encoding="utf-8"?><soap-env:envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:body><soap-env:fault> <faultcode>mail_domain_does_not_exist</faultcode><faultstring>mail domain - domain.tld - not exist.</faultstring></soap-env:fault></soap-env:body></soap-env:envelope> soap error: mail domain - domain.tld
if try adding address writing soap file works fine. idears might have missed?
Comments
Post a Comment