0

ユーザーに送信する前に、スパムのメールをスコアリングするためにSpam-Assassinを使用したいと思います。を使用するプロセスとして実行するためにPHPを使用していexecます。

exec("/usr/bin/spamc -R < {$fname}",$score,$rr);

問題は、返される結果が常に0/0であるということです。PHPクラスのWebサイトからPHPコードを取得しました。使用されているデモメッセージは以下のとおりです

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>free free</title>
<meta content="false" http-equiv="imagetoolbar">
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body>
viagra test test free free
</center></body></html>

何が問題なのか提案してください

4

1 に答える 1

0

proc_open代わりに を使用して、メール コンテンツをパイプする方法を変更してみてくださいexec

$email_content = "Put your email content here."

$descriptorspec = array(
    0 => array("pipe", "r"),  // stdin read by child
    1 => array("pipe", "w"),  // stdout written to by child
    2 => array("file", "/tmp/spamd-error-output.txt", "a") // stderr
);

$process = proc_open("/usr/bin/spamc -R", $descriptorspec, $pipes);

if (is_resource($process)) {
    fwrite($pipes[0], $email_content);
    fclose($pipes[0]);
    $full_output = fgets($pipes[1], 1024);
}
于 2010-10-21T18:56:41.773 に答える