我的计算机上安装了 spamassassin,我想用它来测试来自评论等内容的表单输入(我知道 spamassassin 用于电子邮件,但我找不到任何非电子邮件的东西),但是当我测试废话评论 spamassassin 说它不是垃圾邮件。
我正在使用这个库:httpsspamd
://github.com/templateria/php-spamassassin通过 php发送请求。我正在这样测试:
$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);
laravel 的数据转储显示如下:
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
}
那么,有没有办法让这项工作更好,或者有没有更好的程序来测试非电子邮件垃圾邮件?