I have spamassassin installed on my computer, and I would like to use it to test form input from things such as comments (I know spamassassin is for emails, but I can't find anything for non-email), but when I test a nonsense comment spamassassin says that it is not spam.
I am using this library: https://github.com/templateria/php-spamassassin to send requests to spamd
via php. I am testing like this:
$client = new \Spamassassin\Client(['hostname' => 'localhost']);
$messageid = '<' . time() .'-' . md5('test@gamesmart.com' . 'test@gamesmart.com') . '@' . $_SERVER['SERVER_NAME'] . '>';
$message = "To: test@gamesmart.com\r\n";
$message .= "From: test@gamesmart.com\r\n";
$message .= "Date: " . date("r") . "\r\n";
$message .= "Message-ID: " . $messageid . "\r\n";
$message .= "Subject: Spamassassin Comment Check\r\n\r\n";
$message .= "asdfa sadf sadf af saf s";
$results = $client->getSpamReport($message);
dd($results);
The laravel's data dump is showing this:
Result {#209 ▼
+protocolVersion: "1.1"
+responseCode: "0"
+responseMessage: "EX_OK\r"
+contentLength: "660"
+score: -0.0
+thresold: 5.0
+isSpam: false
+message: """
Spam detection software, running on the system "A1188",\n
has NOT identified this incoming email as spam. The original\n
message has been attached to this so you can view it or label\n
similar future email. If you have any questions, see\n
the administrator of that system for details.\n
\n
Content preview: asdfa sadf sadf af saf s [...] \n
\n
Content analysis details: (-0.0 points, 5.0 required)\n
\n
pts rule name description\n
---- ---------------------- --------------------------------------------------\n
-0.0 NO_RELAYS Informational: message was not relayed via SMTP\n
-0.0 NO_RECEIVED Informational: message has no Received headers
"""
+headers: """
SPAMD/1.1 0 EX_OK\r\n
Content-length: 660\r\n
Spam: False ; -0.0 / 5.0
"""
+didSet: false
+didRemove: false
}
So, is there a way I can make this work better, or is there a better program for testing non-email spam?