From 34f3e621acc61a9d1ded4a6324ba02bb6880f2d2 Mon Sep 17 00:00:00 2001 From: Retro_Guy Date: Fri, 6 Oct 2023 18:32:05 -0700 Subject: [PATCH] Log posts identified as spam to log file. --- Rocksolid_Light/rocksolid/newsportal.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Rocksolid_Light/rocksolid/newsportal.php b/Rocksolid_Light/rocksolid/newsportal.php index cb6624f..76ab12f 100644 --- a/Rocksolid_Light/rocksolid/newsportal.php +++ b/Rocksolid_Light/rocksolid/newsportal.php @@ -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,