# spamassassin with qmail-scanner is ignoring local.cf

## Rakefighter

Hello Folks,

I've got a new gentoo server that I've set up with qmail + qmail-scanner + spamassassin.  The server is working great, but I seem to be having a problem with my spamassassin config.  As far as I can tell, spamassassin is ignoring the settings in /etc/mail/spamassassin/local.cf.  According to what I've read, the following config should rewrite the subjects of all incoming emails by inserting the phrase "[SPAM]" at the beginning:

```

postman 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

# trusted_networks 212.17.35.

report_safe 1

rewrite_subject 1

subject_tag [SPAM]

required_hits 5

skip_rbl_checks 1

```

Instead, the messages arrive unaltered.  The messages do include the spamassassin headers, and if I change 'required_hits' that change is also reflected in the message headers.  The 'rewrite_subject' entry seems to be ignored, however.

Can anybody give me some advice on this?

Thanks,

Rakefighter

----------

## mr_daemon

This is normal, the rewrite subject parameter does not take effect for some reason. It can, however, be fixed by editing the qmail-scanner file. This is how things work in my setup, at least  :Smile: 

----------

## Rakefighter

 *mr_daemon wrote:*   

> This is normal, the rewrite subject parameter does not take effect for some reason. It can, however, be fixed by editing the qmail-scanner file. This is how things work in my setup, at least 

 

I've read about that fix and successfully applied it, but other functionality seems to be ignored, as well:

```
report_safe 1 
```

This should alter the message so that the user recieves a "spam report" with the original message attached to it, but this setting appears to be ignored, as well.  Editing the qmail-scanner scanner file isn't really a long term solution, because spam filtering will break every time qmail-scanner is upgraded, not to mention the confusion that stems from spamassassin ignoring its own configuration files...

----------

## madrobby

 *Rakefighter wrote:*   

> 
> 
> ```
> report_safe 1 
> ```
> ...

 

UPDATE: Found a working solution...

The script /var/qmail/binqmail-scanner-queue.pl contains the following setting:

```
my $spamc_options=' -c -f';
```

Change this to:

```
my $spamc_options=' -f';
```

Now, SpamAssassin is not used to just check the mail, but the converted mail from SpamAssassin is taken. To see the available options for the local.cf File in /etc/mail/spamassassin, use:

```
# man Mail::SpamAssassin::Conf
```

Note that I use the rules_du_jour script to update my custom rulesets regularily. Just google "rulesdujour" for this. Also note that the version of SpamAssassin in the current ebuild (2.63) doesn't support the "report_header" and the "ok_language" directives. You have to comment these out for the rulesdujour script to work correctly, or you'll get errors on "spamassassin --lint".

thomas

----------

## Rakefighter

So...what you're really saying is that the qmail-scanner package is broken.  I looked into this and found a few bugs posted on bugs.gentoo.org, but the qmail-scanner mailtainer seems to be on an arrogant high-horse about qmail-scanner NOT being broken.

He seems to feel that it is acceptable behaviour for spamassassin to not only completely ignore it's own configuration file, but to be configured from the automatically generated, transient qmail-scanner perl script!

Thanks for the detailed information, but you still haven't addressed my original issue:  What happens when qmail-scanner is upgraded?  

I'll tell you what happens:  Spam filtering breaks!

----------

## AlienDaycare

From everything I've read, qmail-scanner under Gentoo gets installed with the default set to use --sa-alt which uses the alternate FAST_SPAMASSASSIN code. This code essentially ignores the very things you are mentioning.

My guess is that by removing the '-c' from the option set, you are disabling the alternate code and causing spamassassin to use the normal /etc/mail/spamassassin/local.cf things.

However: I don't know if it's because I've followed so many different guides on setting qmail up, but I also have a /var/qmail/.spamassassin directory which has a user_prefs which seem to take precedence over the /etc/mail... file.

At any rate, the perl qmail-scanner script is supposedly set up to *not* get clobbered by newer versions, but will instead show up in list of files to update using etc-update.

I'm beginning to see why some people refuse to use anything related to qmail from portage opting, rather, to compile from source.

PS. qmail-scanner 1.16 is NOT recent. As of this post, 1.23 is recent.

P.P.S. I use the sa-alt feature, and rewrite my subjects using the $sa-subject=':SPAM:'  in my configuration of the perl qmail-scanner. I sure hope the folks that edit the ebuilds decide to make 1.23 stable soon....

 - AlienDaycare

Successfully running qmail, qmail-scanner, clamav, spamassassin, bincimap, and squirrelmail, using stable builds. It's not pretty...

----------

## mobiusproject

What is your /etc/conf.d/spamd look like?

Mine is

```
SPAMD_OPTS="-d -v -u vpopmail --siteconfigpath=/etc/mail/spamassassin/local.cf"
```

which works great for me.

I am trying to remember where I got this line from, but I do remember looking at spamassassin.apache.org to make sure that it is exactally what I need.  The line from sabrex's howto's is really screwed up.

----------

## Cuardin

OK, I have the same symptoms, but ina  different setup.

I use fetchmail->procmail->spamassassin. Since I upgraded to the most current version about a week ago I get about half of my spam with rewritten subjects.

All spam gets detected and is rewritten to a report detailing the spammyness with the original email as an attachment. But the subjectline is not allways edited.

This is rather irritating, even if all I have to do is use procmail to filter on the XSpamStatus instead of on the subject line.

Any ideas?

----------

## guitard00d

 *Rakefighter wrote:*   

> So...what you're really saying is that the qmail-scanner package is broken.  I looked into this and found a few bugs posted on bugs.gentoo.org, but the qmail-scanner mailtainer seems to be on an arrogant high-horse about qmail-scanner NOT being broken.
> 
> He seems to feel that it is acceptable behaviour for spamassassin to not only completely ignore it's own configuration file, but to be configured from the automatically generated, transient qmail-scanner perl script!

 

For what it's worth, I call spamc directly from my .mailfilter script (a'la maildrop) rather than calling spamassassin from within qmail-scanner because spamassassin is a serious resource hog. Anyway, I had to add --siteconfigpath=/etc/mail/spamassassin/local.cf to the end of my SPAMD_OPTS line in /etc/conf.d/spamd in order for it to honor all of my rules (including rewriting the subject line). So even though you might think the qmail-scanner maintainer is a bit high on himself, I have to say that the problem you're having with spamassassin isn't related to qmail-scanner. The entire spamassassin package for Gentoo appears to be broken and will not read its own default config files, you now have to explicitly declare the correct site-wide configuration file.

----------

