#1
Posted 16 February 2013 - 11:09 AM
I have some curiosity..
(1) what does spam_input > spam_outout in the following command line mean?
exec('spamassassin spam_input > spam_output');
(2) is it possible for me to find out myself the path of spamassassin?
Thanks.
#2
Posted 16 February 2013 - 04:47 PM
2) locate spamassassin
http://thorpesystems.com | http://proemframework.org | http://github.com/trq
SmtpCatcher - A very simple mock sendmail useful for testing PHP mail scripts.
#3
Posted 16 February 2013 - 08:15 PM
but im seeing that the file is empty all the time.
does it mean that spamassassin is not working at all? also i have no acess to execuite unix command, any path where it will usually be located?
thanks.
#4
Posted 17 February 2013 - 11:40 AM
spamassasin from it, no..?
#5
Posted 18 February 2013 - 11:49 PM
You have PHP don't you, and you're executing
spamassasinfrom it, no..?
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.
#6
Posted 19 February 2013 - 01:58 AM
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?
That is the directory for your user preferences where you can change the configuration settings of spamassassin. You need the location to the spamassassin executable file, which most likely is something like /usr/bin/spamassassin or /usr/local/bin/spamassassin. The following PHP script may be able to locate it for you. If not, ask your host again but make it clear you need the location for the executable, not the preferences.
<?php
system('which spamassassin');
?>
Stick that in a file, upload it to your site then run it.
Did I help you out? Feeling generous? I accept tips via Paypal or Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7
#7
Posted 19 February 2013 - 02:24 AM
I have attempted to run the php script provided above, but it is giving empty output.
What is this suppose to mean?
#8
Posted 19 February 2013 - 04:43 AM
http://thorpesystems.com | http://proemframework.org | http://github.com/trq
SmtpCatcher - A very simple mock sendmail useful for testing PHP mail scripts.
#9
Posted 19 February 2013 - 09:07 AM
I have managed to get the path of spamassassin from my webhost.
exec('/usr/local/lib/perl5/site_perl/5.8.8/Mail/SpamAssassin/spamassassin spam_input > spam_output');
$spam_out = file('spam_output');
$score = 0.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;
}
The same problem im having here. The whole post is in file spam_input as follow
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, it is not being copied to spam_output.
When checked, the last changed date of spam_input and spam_output is the same, so I assume there's an attempt to copy content of spam_input to spam_output, however nothing is being copied.
Can advise?
Thanks.
#10
Posted 19 February 2013 - 02:21 PM
Let's say that we have only two files - execution.php and spam_input.
Execution.php is the file that we want to execute when the php script is running and spam_input is the file which holds the the content that we want to redirect to spam_output.
spam_input
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
execution.php
exec("cat spam_input > spam_output");
After that content has been printed to the new file called spam_output, you can handle it with php.
My question is how to get the spam list to the spam_input file?
EDIT: If you want to add a new content to the same file without deleting the old one you should use a ">>" symbol.
Edited by jazzman1, 19 February 2013 - 02:35 PM.
#11
Posted 19 February 2013 - 11:59 PM
Thanks, the unix command cat does copy the content to spam_output.
Question, normally when spamassassin is executed, it should add in "X-Spam-Status" and the spam score?
But, in my case, it doesn't.
Already tried to add these to the user_prefs file.
add_header all
always_add_headers 1
use_bayes 1
required_score 5
score FB_SSEX 10
score HTML_COMMENT_8BITS 3
score OBSCURED_EMAIL 3
score ONLINE_PHARMACY 10
score SUBJ_ILLEGAL_CHARS 3
score UPPERCASE_25_50 3
score UPPERCASE_50_75 3
score UPPERCASE_75_100 3
score VIA_GAP_GRA 3
Can you advise? Thanks.
#12
Posted 20 February 2013 - 07:16 AM
Question, normally when spamassassin is executed, it should add in "X-Spam-Status" and the spam score?
But, in my case, it doesn't.
Did you read the documentation how does this mail filter work?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











