2

私のコンピューターには spamassassin がインストールされており、それを使用してコメントなどからのフォーム入力をテストしたいと考えています (spamassassin が電子メール用であることは知っていますが、電子メール以外のものは見つかりません)。ナンセンス コメント spamassassin は、スパムではないと言っています。

私はこのライブラリを使用しています: https://github.com/templateria/php-spamassassinspamdを使用して、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
}

では、これをよりうまく機能させる方法はありますか、または電子メール以外のスパムをテストするためのより良いプログラムはありますか?

4

1 に答える 1

2

ポジティブにしたい場合は、テキストをスパムのように見せる必要があります。GTUBEが役立ちます。文字列をテキストに貼り付けXJS*C4JDBQADN1.NSBN3*2IDNEN*GTUBE-STANDARD-ANTI-UBE-TEST-EMAIL*C.34Xます。

spamassassin は、これを使用するのに最適なものではありませんが、spammeer のものをいくつか見つけることができます。また、spamassassin ルールセットを拡張して、スパムとして捕捉する必要があると思われるものを追加することもできます。

于 2016-03-07T20:33:34.920 に答える