setStartTime( $t, $m );
$challenge->setMode( $mode );
$challenge->setReportType( $reportType );
//$challenge->run('reset', $domain, $account); //Reset - all items will be treated as NEW
$challenge->run('report', $domain, $account ); //Report - send report emails
//$challenge->run('empty'); //Empty - for testing
//$challenge->run('test'); //Test - test callback
if($challenge->getDebugging() > 1){
echo "Total memory:".memory_get_usage();
echo "Total time:".$challenge->duration();
echo "Total parsing time:".($ptime);
echo "Total send time:".($stime);
}
echo "OK";
}catch(Exception $e){
icewarp_releaselock('challenge');
$api = IceWarpAPI::instance();
$primarydomain = $api->getDomain(0);
$email = 'admin@'.$primarydomain;
try{
$mail = new slMail();
$mail->SMTPAutoTLS = $api->getProperty('c_system_adv_ext_sslservermethod')!=5 && $api->getProperty('c_system_adv_ext_sslservermethod')!=6;
$mail->setSendMode('string');
$RecDomain = explode("@", $email);
$address = $challenge->reportFrom['address'];
$address = str_ireplace("%%recipient_domain%%", $primarydomain, $address);
$display = $challenge->reportFrom['display'];
$mail->setFrom($address,$display);
$mail->addTo($email);
$mail->setSubject("Spam reports error notification");
$mail->setBody("There was following error during last spam report : ".($e->challengeMsg?$e->challengeMsg:$e->getMessage()));
$mail->send();
}catch(Exception $e){
//Ignore send message error
}
echo '';
if($e->challengeMsg){
echo $e->challengeMsg;
}else{
echo $e->getMessage();
}
echo '
';
}
?>