Log posts identified as spam to log file.

This commit is contained in:
Retro_Guy 2023-10-06 18:32:05 -07:00
parent c119f48ec8
commit 34f3e621ac
1 changed files with 5 additions and 1 deletions

View File

@ -1306,8 +1306,9 @@ function is_multibyte($s)
function check_spam($subject, $from, $newsgroups, $ref, $body, $msgid)
{
global $msgid_generate, $msgid_fqdn, $spooldir;
global $msgid_generate, $msgid_fqdn, $spooldir, $logdir;
global $CONFIG;
$logfile = $logdir . '/spam.log';
$spamfile = tempnam($spooldir, 'spam-');
$tmpheader = 'From: ' . $from . "\r\n";
@ -1342,6 +1343,9 @@ function check_spam($subject, $from, $newsgroups, $ref, $body, $msgid)
}
fclose($spamFileHandle);
unlink($spamfile);
if ($res === 1) {
file_put_contents($logfile, "\n" . format_log_date() . " " . $spamresult . "\n------------\n", FILE_APPEND);
}
return array(
'res' => $res,
'spamresult' => $spamresult,