dongmaqiu6084 2015-07-23 15:02
浏览 8

ISPConfig批量邮件添加SOAP失败,域名不存在,尽管它确实存在

I tried adding mailadresses saved in a txt file, one per line, with the 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 as $zeile)
{
    //* Set the 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 i run this code i always get the 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 - does not exist.</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope> SOAP Error: Mail domain - domain.tld

If i just try adding the address by writing it into the soap file all works fine. Any idears what i might have missed?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥188 需要修改一个工具,懂得汇编的人来。
    • ¥15 livecharts wpf piechart 属性
    • ¥20 数学建模,尽量用matlab回答,论文格式
    • ¥15 昨天挂载了一下u盘,然后拔了
    • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
    • ¥20 易康econgnition精度验证
    • ¥15 msix packaging tool打包问题
    • ¥28 微信小程序开发页面布局没问题,真机调试的时候页面布局就乱了
    • ¥15 python的qt5界面
    • ¥15 无线电能传输系统MATLAB仿真问题