Hi Guru,
Yes, I'm executing it from a php script. But I'm not getting the correct spam score. It is always giving zero.
I'm checking with my webhost, they told me the path to spamassassin is /home/den/.spamassassin,
but when I'm checking in that particular directory, only saw these files... bayes_seen, bayes_toks, user_prefs.
Is this really the directory then?
exec('/home/den/.spamassassin spam_input > spam_output');
$spam_out = file('spam_out');
$score = 5.0;
for ($i = 0; $i < count($spam_out); $i++) {
if (!(strpos($spam_out[$i], "X-Spam-Status") === FALSE)) {
$score = floatval(substr($spam_out[$i], strpos($spam_out[$i], 'score=') + 6));
break;
}
}
In spam_input file, I can see the following
From: "denc" <test@test.com>
Received: from test.com (test.com [210.195.151.218])
To: email@domain.com
Subject: messsage
Date: Mon, 18 Feb 2013 23:46:02 EST
test message
However, this is not copied to spam_output...
it is always empty.
I'm suspecting the some issue with spamassassin?
Thanks.