Jump to content

Recommended Posts

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.

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.

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.

 

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.

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

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.