Jump to content


Photo

SPAMASSASSIN not really working

spamassassin

  • Please log in to reply
11 replies to this topic

#1 denc

denc

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 16 February 2013 - 11:09 AM

Hi,

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 trq

trq

    Advanced Member

  • Administrators
  • 30,973 posts
  • LocationSydney, Australia.

Posted 16 February 2013 - 04:47 PM

1) It redirects the output of "spamassassin spam_input" into a file called spam_output
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.
OPM - My Linux package manager.


#3 denc

denc

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 16 February 2013 - 08:15 PM

spam_input will contain the message sent by visitor. if it will be copied into spam_output, i would expect some content in spam_output?
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 Christian F.

Christian F.

    Advanced Member

  • Staff Alumni
  • 3,106 posts
  • LocationNorway

Posted 17 February 2013 - 11:40 AM

You have PHP don't you, and you're executing spamassasin from it, no..? ;)
Keeping it simple.

#5 denc

denc

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 18 February 2013 - 11:49 PM

You have PHP don't you, and you're executing spamassasin from 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 kicken

kicken

    Wiser? Not exactly.

  • Gurus
  • 2,669 posts
  • LocationBonita, FL

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.

Recycle your old CD's, don't trash them!
Did I help you out?  Feeling generous? I accept tips via Paypal or Bitcoin @ 14mDxaob8Jgdg52scDbvf3uaeR61tB2yC7

#7 denc

denc

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 19 February 2013 - 02:24 AM

Hi guru,

I have attempted to run the php script provided above, but it is giving empty output.
What is this suppose to mean?

#8 trq

trq

    Advanced Member

  • Administrators
  • 30,973 posts
  • LocationSydney, Australia.

Posted 19 February 2013 - 04:43 AM

You seriously need to get managed hosting.

http://thorpesystems.com | http://proemframework.org | http://github.com/trq

SmtpCatcher - A very simple mock sendmail useful for testing PHP mail scripts.
OPM - My Linux package manager.


#9 denc

denc

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 19 February 2013 - 09:07 AM

Hi all,

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 jazzman1

jazzman1

    Advanced Member

  • Gurus
  • 2,443 posts
  • LocationMississauga, Canada

Posted 19 February 2013 - 02:21 PM

Use the "cat" unix command.

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 denc

denc

    Newbie

  • Members
  • Pip
  • 8 posts

Posted 19 February 2013 - 11:59 PM

Hi there,

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 jazzman1

jazzman1

    Advanced Member

  • Gurus
  • 2,443 posts
  • LocationMississauga, Canada

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

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com