syslog the queue id of the restored email

Signed-off-by: Janos SUTO <sj@acts.hu>
This commit is contained in:
Janos SUTO 2020-03-14 07:02:19 +01:00
parent b3f37f2964
commit e4f64b41bc

View File

@ -5,6 +5,7 @@ class ModelMailMail extends Model {
public function send_smtp_email($smtphost, $smtpport, $yourdomain, $from, $to = array(), $msg){
$ok = 0;
$queue_id = '';
if($to == "" || strlen($msg) < 30){ return $ok; }
@ -40,14 +41,14 @@ class ModelMailMail extends Model {
$l = fgets($r, 4096);
if(preg_match("/^250/", $l)){ $ok = 1; }
if(preg_match("/^250/", $l)){ $queue_id = $l; $ok = 1; }
fputs($r, "QUIT\r\n");
$l = fgets($r, 4096);
fclose($r);
syslog(LOG_INFO, "sending mail from=$from, rcpt=" . implode(" ", $to) . ", status=$ok");
syslog(LOG_INFO, "sending mail from=$from, rcpt=" . implode(" ", $to) . ", status=$ok, queue_id=$queue_id");
return $ok;
}