Example #1
0
}
require_once 'settings.php';
$q = $dbh->prepare('SELECT * FROM release_sender WHERE found = -1;');
$q->execute();
while ($row = $q->fetch(PDO::FETCH_ASSOC)) {
    sleep(3);
    $host = $soap_hosts[$row['node']];
    if (!$host) {
        echo "Invalid node\n";
        continue;
    }
    $id = $row['msgid'];
    echo "Fetching {$id} from {$host}\n";
    try {
        $client = new SoapClient('https://' . $host . '/remote/?wsdl', ['features' => SOAP_SINGLE_ELEMENT_ARRAYS, 'location' => 'https://' . $host . '/remote/', 'uri' => 'urn:halon', 'login' => $soap_user, 'password' => $soap_pass]);
        $items = $client->mailQueue(array('filter' => 'messageid=' . $id . ' quarantine=' . $quarantine_short, 'offset' => '0', 'limit' => 50));
    } catch (Exception $e) {
        echo $e->getMessage();
        continue;
    }
    if (!isset($items->result->item) || count($items->result->item) < 1) {
        echo "Email not found\n";
        $q2 = $dbh->prepare('UPDATE release_sender SET found=0 WHERE id = :id;');
        $q2->execute([':id' => $row['id']]);
        continue;
    }
    $mail = $items->result->item[0];
    $rpdscore = -1;
    $rpdrefid = '';
    if (isset($mail->msgscore->item)) {
        foreach ($mail->msgscore->item as $score) {