# SpamAssassin 2.6 not rating incoming emails?

## squash

Hi All,

I updated my mail server to SpamAssassin 2.60, and after some fiddling I got it to run to completion (it runs as user nobody if you don't specify a username, my conf files were owned by mail). Anyway, once I got it working, it always spits out a spam score of 0.0! I tested by executing

cat [message file] | spamassassin

I downgraded back to 2.55 and it is corectly rating messages again.  Anyone have any suggestions?

Squash

----------

## Chris W

I ran this upgrade last night, restarted spamd, and it is working fine this morning.    I am not running spamd with the -u flag, so permission problems are not an issue.  If I had to guess I'd say that permissions are getting the better of you.

----------

## myconid

```

www23 root # cat /etc/mail/spamassassin/local.cf

# This is the right place to customize your installation of SpamAssassin.

# See 'perldoc Mail::SpamAssassin::Conf' for details of what can be

# tweaked.

#

###########################################################################

#

#rewrite_subject 0

#report_safe 1

# Enable subject modification

rewrite_subject 1 

```

Or:

```

www23 .spamassassin # cat /home/USER/.spamassassin/user_prefs 

rewrite_subject         1

subject_tag             *****SPAM*****

# Bonus Stuff I use:

# Enable the Bayes system

use_bayes               1

# Enable Bayes auto-learning

auto_learn              1

skip_rbl_checks         0

use_razor2              1

use_dcc                 1

use_pyzor               1

```

----------

## BitJam

I had the same problem: 2.6 was not rating incoming mail when used with filters inside of kmail.   I was able to get it to rate messages via the command line but could not get it to work inside of kmail.

I also went back to 2.55.

----------

## Dalrain

Also having a bit of an SA issue, though I don't use spamd.  I have a rather small installation, so I was filtering on an individual basis with this in the user's directories that wanted SA:

```
|spamassassin -P |/usr/local/bin/maildir ./.maildir/
```

This was working great up until I upgraded, at which point mail became stripped of everything, all headers, and all content...the only thing left being the "Reply-To" address...which is fairly useless.   Pretty serious bug..hope it's fixed soon.  (If anyone knows why, please let me know?)

-D

----------

## Vyper

Strange ...

I have upgraded to v2.6.0, too. Then I realized that no mail was filtered out. I looked into the header of an obvious spam mail in KMail and saw this:

```
X-Spam-Status: No, hits=10.4 required=9999.0

   tests=BANG_GUARANTEE,CLICK_BELOW,DATE_IN_FUTURE_03_06,

         FROM_ENDS_IN_NUMS,HTML_40_50,HTML_LINK_CLICK_CAPS,

         HTML_LINK_CLICK_HERE,HTML_MESSAGE,LOW_PRICE,

         MIME_HTML_NO_CHARSET,MIME_HTML_ONLY,MIME_LONG_LINE_QP,

         MISSING_MIMEOLE,MISSING_OUTLOOK_NAME,RATWARE_EGROUPS

   version=2.54

X-Spam-Level: **********

X-Spam-Checker-Version: SpamAssassin 2.54 (1.174.2.17-2003-05-11-exp)
```

This is odd, because

1. SpamAssassin 2.54 doesn't seem to be installed anywhere ("which spamassassin" returns /usr/bin/spamassassin and "spamassassin -V" returns 2.60)

2. ~/.spamassassin/user_prefs contains the line "required_hits           5", so why is it set to 9999.0?

3. 5.0 has always been the standard value (not 9999.0), and I haven't changed anything

----------

## oscarwild

same effect as described by Dalrain here. Some mail DID get filtered out, but instead of the usual score report, I got empty mails without receipient entry. strange...

A downgrade to 2.55-r1 did the job for me, thx!

----------

## Dalrain

Vyper:  I have to wonder if you still have your copy of SA running in memory.  (The older version.)  Did you restart the deamon, so that it would be running the all new binary?

Strange on that 9999 thing though, maybe that has something to do with the insanity the rest of us are seeing...I have to wonder.

I too have not changed anything, save for upgrading.  I noticed that rc3 is the newest version available from the SA folks..I have to wonder if another e-build upgrade would be a good idea?

----------

## blade-

I am having trouble with the new spamassassin aswell, its not checking all the mail, very few of them are, the log seems to suggest it is checking it then it just gets delivered before its finished checking, no error message just stops half way through checking.

----------

## Esteban

My spamassassin configuration is global... I mean by the file 

```
/etc/mail/spamassassin/local.cf
```

In each user directory, there was a directory called :

```
.spamassassin
```

 which seamed to contain configuration from the old version... So, I decided to erase all these directories...

I modified too the init.d script (when you emerge spamassassin, it tell you to use spamassassin with export LANG=en_US) :

```
#!/sbin/runscript

# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License, v2 or later

 

# NB: Config is in /etc/conf.d/spamd.conf

 

depend() {

        need net.adsl

        before fetchmail

}

 

start() {

        ebegin "Starting spamd"

        export LANG=en_US

        start-stop-daemon --start --quiet \

                --exec /usr/bin/spamd -- -d -r /var/run/spamd.pid \

                        ${SPAMD_OPTS}

        eend $? "Failed to start spamd"

}

 

stop() {

        ebegin "Stopping spamd"

        start-stop-daemon --stop --quiet --pidfile /var/run/spamd.pid

        eend $? "Failed to stop spamd"

}
```

Then, in procmail, I added a variable before spamassassin : export LANG=en_US...

And now, all seams to run well... Spams are well identified...

----------

## andyknownasabu

 *squash wrote:*   

> Hi All,
> 
> I updated my mail server to SpamAssassin 2.60, and after some fiddling I got it to run to completion (it runs as user nobody if you don't specify a username, my conf files were owned by mail). Anyway, once I got it working, it always spits out a spam score of 0.0! I tested by executing
> 
> cat [message file] | spamassassin
> ...

 

Try to use the recent exiscan-acl patch, the exim 4.22 ebuild uses the

old version -10, perhaps that is the solution to your problem.

Cheers

----------

## Esteban

I thought it ran... Just few spams are well detected... But more than before...

----------

## russTypeS

i have the same problem,  some email gets through fine, some causes spamassassin to exit like this:

```

Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/vendor_perl/5.8.0/Mail/SpamAssassin/Dns.pm line 303.

procmail: Program failure (70) of "spamassassin"

procmail: Rescue of unfiltered data succeeded

```

----------

## BitJam

 *russTypeS wrote:*   

> i have the same problem,  some email gets through fine, some causes spamassassin to exit like this:
> 
> ```
> 
> Can't use an undefined value as an ARRAY reference at /usr/lib/perl5/vendor_perl/5.8.0/Mail/SpamAssassin/Dns.pm line 303.
> ...

 

I posted a fix for this problem in a different thread.   

 *Quote:*   

>  ...the fix is to replace 303 with: 
> 
> ```
>     my $rules = join(",", @{$query->[RULES] || [] }); 
> ```
> ...

 

----------

## Dalrain

I noticed today that the official stable e-build seems to have reverted, so that should help out most folks here.  A simple emerge rsync and emerge -u world will probably catch it until .60 becomes totally stable.  Thanks for the help everyone!    :Smile: 

----------

## andyknownasabu

 *Esteban wrote:*   

> I thought it ran... Just few spams are well detected... But more than before...

 

Well, in the meanwhile I've also noticed that the current spamassassin-2.60 ebuild uses a very odd tar.gz which I can't find on the official ftp server of the spamassassin project at all. Seems to be the (out of date) -rc1 version of spamassasin...

-> I downloaded the most current version -rc4, added an own ebuild-file 2.60-r1 and now everything works fine.

I had to make some modifications but I can post the ebuild here if someone is interested...

----------

## el*Loco

 *andyknownasabu wrote:*   

> -> I downloaded the most current version -rc4, added an own ebuild-file 2.60-r1 and now everything works fine.
> 
> I had to make some modifications but I can post the ebuild here if someone is interested...

 

That would be nice ...

----------

## andyknownasabu

 *el*Loco wrote:*   

> That would be nice ...

 

No problem ;)

```

# Copyright 1999-2003 Gentoo Technologies, Inc.

# Distributed under the terms of the GNU General Public License v2

# $Header: /home/cvsroot/gentoo-x86/dev-perl/Mail-SpamAssassin/Mail-SpamAssassin-2.60-r1.ebuild,v 1.4 2003/09/12 06:14:20 rajiv Exp $

inherit perl-module

S=${WORKDIR}/${P}

DESCRIPTION="Perl Mail::SpamAssassin - A program to filter spam"

SRC_URI="http://www.spamassassin.org/released/${P}-rc4.tar.gz"

HOMEPAGE="http://www.spamassassin.org"

IUSE=""

SLOT="0"

LICENSE="GPL-2 | Artistic"

KEYWORDS="~x86 ~amd64 ~ppc ~sparc ~alpha"

DEPEND="dev-perl/Net-DNS

   dev-perl/HTML-Parser

   dev-perl/PodParser

   dev-perl/Time-Local

   berkdb? ( dev-perl/DB_File ) "

RAZORVERINS=`best_version net-mail/razor`

myconf="PREFIX=/usr SYSCONFDIR=/etc CONTACT_ADDRESS=root@localhost"

# If ssl is enabled, spamc can be built with ssl support

if [ "`use ssl`" ];

then

   myconf="${myconf} ENABLE_SSL=yes"

fi

if [ ! -z "${RAZORVERINS}" ];

then

   myconf="${myconf} RUN_RAZOR2_TESTS=n"

fi

mymake="PREFIX=/usr SYSCONFDIR=/etc"

mydoc="License Changes procmailrc.example sample-nonspam.txt sample-spam.txt"

src_compile() {

   perl-module_src_compile

   dodir /etc/mail/spamassassin

}

src_install () {

   perl-module_src_install

   dodir /etc/init.d /etc/conf.d

   cp ${FILESDIR}/spamd.init ${D}/etc/init.d/spamd

   chmod +x ${D}/etc/init.d/spamd

   cp ${FILESDIR}/spamd.conf ${D}/etc/conf.d/spamd

}

pkg_postinst() {

   perl-module_pkg_postinst

   ewarn "Message from the author of SpamAssassin:"

   einfo ""

   einfo "Perl 5.8 now uses Unicode internally by default, "

   einfo "which causes trouble for SpamAssassin (and almost"

   einfo "all other reasonably complex pieces of perl code!)."

   einfo ""

   einfo "Setting the LANG environment variable before any "

   einfo "invocation of SpamAssassin sometimes seems to help"

   einfo "fix it, like so:"

   einfo ""

   ewarn "  export LANG=en_US"

   einfo ""

   einfo "Notably, the LANG setting must not include utf8. "

   einfo "However, some folks have reported that this makes"

   einfo "no difference. ;)"

}
```

----------

## BitJam

I tried andyknownasabu's ebuild.  It merged okay.  I restarted spamd and it scores incoming emails.  Only problem is that it seems to give them all a score of zero: 

```
X-Spam-Checker-Version: SpamAssassin 2.60-rc4 (1.203-2003-08-29-exp) on 

        $HOSTNAME

X-Spam-Level: 

X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=ham 

        version=2.60-rc4
```

Any suggestions?

----------

## andyknownasabu

 *BitJam wrote:*   

> I tried andyknownasabu's ebuild.  It merged okay.  I restarted spamd and it scores incoming emails.  Only problem is that it seems to give them all a score of zero: 
> 
> ```
> X-Spam-Checker-Version: SpamAssassin 2.60-rc4 (1.203-2003-08-29-exp) on 
> 
> ...

 

What does /var/log/messages say?

What the logfile of your MTA?

----------

## BitJam

 *andyknownasabu wrote:*   

> What does /var/log/messages say?

 

Here is what spamd is saying in my system log file 

```
spamd[2942]: [info] setuid to jbowlin succeeded

spamd[2942]: [processing message <3985f04d487d$710d7674$6ae4840c@aefkmzrrtmm.jyr> for jbowlin] 1000.

spamd[2942]: [clean message (0.0/5.0) for jbowlin] 1000 in 1.2 seconds, 1427 bytes.

spamd[2949]: [info] setuid to jbowlin succeeded

spamd[2949]: [processing message <b440723e5088$eb155a40$85c1f9f2@xuvtfysljga.ehl> for jbowlin] 1000.

spamd[2949]: [clean message (0.0/5.0) for jbowlin] 1000 in 0.9 seconds, 1518 bytes.
```

 *Quote:*   

> What the logfile of your MTA?

 

I am using kmail to grab messages from a pop3 box so there is no useful mta log that I know of.

----------

## andyknownasabu

 *BitJam wrote:*   

>  *andyknownasabu wrote:*   What does /var/log/messages say? 
> 
> Here is what spamd is saying in my system log file 
> 
> ```
> ...

 

I don't understand that: You have a logfile from spamd but not from your MTA? Even if you receive your mail from a pop3 box: If you have your mail scanned by spamd you should also have an MTA logfile because only MTAs can use spamd to scan mail... kmail can't do that AFAIK

Did you try to scan your mail by hand with spamc?

----------

## BitJam

 *andyknownasabu wrote:*   

> I don't understand that: You have a logfile from spamd but not from your MTA? Even if you receive your mail from a pop3 box: If you have your mail scanned by spamd you should also have an MTA logfile because only MTAs can use spamd to scan mail... kmail can't do that AFAIK
> 
> Did you try to scan your mail by hand with spamc?

 

It is really easy to have kmail run spamd automatically.   It has full featured mail filters.    I am currently piping all incoming mail through the spamc program.   You can see the spamd messages in my log and you can see the headers that it adds to the email.   

The earlier versions of spamassassin worked pretty well.   I upgraded using the ebuild that was posted above and now the new version (2.60-r4) still doesn't rate me email.   It runs but everything comes out ham.

----------

