You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Arik Raffael Funke <ar...@gmx.de> on 2006/08/05 14:08:45 UTC

Always add report headers

Hi,

how to I get spamd/spamc to always add the spamassassin report headers? 
I.e. also to ham messages...

I have the following in my local.cf and user_pref.cf but to no apparent use:

use_auto_whitelist 0
use_bayes 0
add_header all Report _REPORT_
add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ tests=_TESTS_ 
autolearn=_AUTOLEARN_ version=_VERSION_

I am using version 3.1.4.

Cheers,
Arik


Re: Always add report headers

Posted by Nigel Frankcom <ni...@blue-canoe.net>.
On Sat, 05 Aug 2006 14:08:45 +0200, Arik Raffael Funke
<ar...@gmx.de> wrote:

>Hi,
>
>how to I get spamd/spamc to always add the spamassassin report headers? 
>I.e. also to ham messages...
>
>I have the following in my local.cf and user_pref.cf but to no apparent use:
>
>use_auto_whitelist 0
>use_bayes 0
>add_header all Report _REPORT_
>add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ tests=_TESTS_ 
>autolearn=_AUTOLEARN_ version=_VERSION_
>
>I am using version 3.1.4.
>
>Cheers,
>Arik


On checking further that last post may not have any effect. Some
setups are known to have their own way with headers. What setuo are
you using?

http://spamassassin.apache.org/full/3.1.x/dist/doc/Mail_SpamAssassin_Conf.html

KR

Nigel

Re: Always add report headers

Posted by Arik Raffael Funke <ar...@gmx.de>.
Craig Morrison wrote:
> Arik Raffael Funke wrote:
>> Nigel Frankcom wrote:
>>> On Sat, 05 Aug 2006 14:08:45 +0200, Arik Raffael Funke
>>> <ar...@gmx.de> wrote:
>>>> how to I get spamd/spamc to always add the spamassassin report 
>>>> headers? I.e. also to ham messages...
>>>>
>>>> I have the following in my local.cf and user_pref.cf but to no 
>>>> apparent use:
>>>>
>>>> use_auto_whitelist 0
>>>> use_bayes 0
>>>> add_header all Report _REPORT_
>>>> add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ 
>>>> tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_
>>>>
>>>> I am using version 3.1.4.
>>>
>>> report_safe            1
>>
>> That wasn't it either. As I understand the documentation this config 
>> variable is supposed to attach the original message unmodified to a 
>> spamassassin spam report message. This is not what I was looking for.
>>
>> For me the usual X-Spam-Status headers suffice, but I also want them 
>> in ham. As a call with "spamassassin ham.txt" would produce... just I 
>> want them also with "less ham.txt | spamc".
>>
>> I attach my local.cf below to avoid any uncertainties.
> The point is, who or what is calling spamassassin..
> 
> You have to have something in the mix of things that is screwing with 
> your headers. Even with report_safe 0, SA adds the X-Spam* headers..
> 

Ok, my setup is as follows:
I run a spamd daemon and use a .qmail file with the following entry to 
invoke spamassassin:

|ifspamh user-spam

No other treatment of the messages occurs afterwards. The user has no 
user_pref.cf file to begin with (An essentially empty one is obviously 
created by spamassassin on its first run). As to anything else, I use 
spamassassin straight "out of the box". I do not see, which other 
configuration files could contribute to the problem. Any hits where to look?

Cheers,
Arik


Re: Always add report headers

Posted by Ollie Acheson <oa...@acheson.org>.
Arik -

I think the problem is one of understanding what is happening with the
.qmail + ifspamh processing.

The first line of .qmail invokes ifspamh with a copy of the email on stdin.
ifspamh then invokes spamassassin and, if spam, delivers to the designated
spam destination and exits 99 so the .qmail file does nothing more. If not
spam, it does not deliver (which means the spamassassin-modified email is
discarded) and exits 0. With an exit 0, the .qmail file then delivers the
unmodified email to the "good email" maildir.

So, only spam-designated emails end up with spamassassin headers. The good
emails effectively by-pass spamassassin.

A alternative approach is to hand off the email delivery to a mda like
procmail or mailfilter. These can then serially process 1st through spamc,
then through their own filtering language. Emails delivered through this
process will all have spamassassin-created headers, whether spam or not.

Hope this helps.

Ollie


On Sun, Aug 06, 2006 at 12:41:48AM +0200, Arik Raffael Funke wrote:
Nigel Frankcom wrote:
> On Sat, 05 Aug 2006 18:29:04 +0200, Arik Funke <ar...@gmx.de>
> wrote:
>
>> Nigel Frankcom wrote:
>>> On Sat, 05 Aug 2006 14:08:45 +0200, Arik Raffael Funke
>>> <ar...@gmx.de> wrote:
>>>> use_auto_whitelist 0
>>>> use_bayes 0
>>>> add_header all Report _REPORT_
>>>> add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ 
tests=_TESTS_
>>>> autolearn=_AUTOLEARN_ version=_VERSION_
>>>>
>>>> I am using version 3.1.4.
>>> On checking further that last post may not have any effect. Some
>>> setups are known to have their own way with headers. What setuo are
>>> you using?
>> I am using a clean install of spamassassin 3.1.4 from the spamassassin
>> website with rpmbuilt -tb spamassassin...tgz.
>
> Please respond on list with details of your mailserver, OS and any
> other software you use between mail & sa.

In addition to my earlier mail, the remaining info:

I am using FC4 with a self-built (with standard options) qmail based on 
netqmail-1.05. Between the mailserver and spamassassin no other software 
is used besides the ifspamh script by James Grinter 
(http://www.gbnet.net/~jrg/qmail/ifspamh/)

Regards,
Arik


-- 
|---------------------------|
| Ollie Acheson             |
| Morristown, NJ            |
|---------------------------|


Re: Always add report headers

Posted by Arik Raffael Funke <ar...@gmx.de>.
Ollie,

thanks for the explanation... I was really looking at the wrong place.

Cheers,
Arik

Ollie Acheson wrote:
 > Arik -
 >
 > I think the problem is one of understanding what is happening with the
 > .qmail + ifspamh processing.
 >
 > The first line of .qmail invokes ifspamh with a copy of the email on 
stdin.
 > ifspamh then invokes spamassassin and, if spam, delivers to the 
designated
 > spam destination and exits 99 so the .qmail file does nothing more. 
If not
 > spam, it does not deliver (which means the spamassassin-modified email is
 > discarded) and exits 0. With an exit 0, the .qmail file then delivers the
 > unmodified email to the "good email" maildir.
 >
 > So, only spam-designated emails end up with spamassassin headers. The 
good
 > emails effectively by-pass spamassassin.
 >
 > A alternative approach is to hand off the email delivery to a mda like
 > procmail or mailfilter. These can then serially process 1st through 
spamc,
 > then through their own filtering language. Emails delivered through this
 > process will all have spamassassin-created headers, whether spam or not.
 >
 > Hope this helps.
 >
 > Ollie
 >
 >
 > On Sun, Aug 06, 2006 at 12:41:48AM +0200, Arik Raffael Funke wrote:
 > Nigel Frankcom wrote:
 >> On Sat, 05 Aug 2006 18:29:04 +0200, Arik Funke <ar...@gmx.de>
 >> wrote:
 >>
 >>> Nigel Frankcom wrote:
 >>>> On Sat, 05 Aug 2006 14:08:45 +0200, Arik Raffael Funke
 >>>> <ar...@gmx.de> wrote:
 >>>>> use_auto_whitelist 0
 >>>>> use_bayes 0
 >>>>> add_header all Report _REPORT_
 >>>>> add_header all Status _YESNO_, hits=_HITS_ required=_REQD_
 > tests=_TESTS_
 >>>>> autolearn=_AUTOLEARN_ version=_VERSION_
 >>>>>
 >>>>> I am using version 3.1.4.
 >>>> On checking further that last post may not have any effect. Some
 >>>> setups are known to have their own way with headers. What setuo are
 >>>> you using?
 >>> I am using a clean install of spamassassin 3.1.4 from the spamassassin
 >>> website with rpmbuilt -tb spamassassin...tgz.
 >> Please respond on list with details of your mailserver, OS and any
 >> other software you use between mail & sa.
 >
 > In addition to my earlier mail, the remaining info:
 >
 > I am using FC4 with a self-built (with standard options) qmail based on
 > netqmail-1.05. Between the mailserver and spamassassin no other software
 > is used besides the ifspamh script by James Grinter
 > (http://www.gbnet.net/~jrg/qmail/ifspamh/)
 >
 > Regards,
 > Arik
 >
 >


Re: Always add report headers

Posted by Arik Raffael Funke <ar...@gmx.de>.
Nigel Frankcom wrote:
 > On Sat, 05 Aug 2006 18:29:04 +0200, Arik Funke <ar...@gmx.de>
 > wrote:
 >
 >> Nigel Frankcom wrote:
 >>> On Sat, 05 Aug 2006 14:08:45 +0200, Arik Raffael Funke
 >>> <ar...@gmx.de> wrote:
 >>>> use_auto_whitelist 0
 >>>> use_bayes 0
 >>>> add_header all Report _REPORT_
 >>>> add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ 
tests=_TESTS_
 >>>> autolearn=_AUTOLEARN_ version=_VERSION_
 >>>>
 >>>> I am using version 3.1.4.
 >>> On checking further that last post may not have any effect. Some
 >>> setups are known to have their own way with headers. What setuo are
 >>> you using?
 >> I am using a clean install of spamassassin 3.1.4 from the spamassassin
 >> website with rpmbuilt -tb spamassassin...tgz.
 >
 > Please respond on list with details of your mailserver, OS and any
 > other software you use between mail & sa.

In addition to my earlier mail, the remaining info:

I am using FC4 with a self-built (with standard options) qmail based on 
netqmail-1.05. Between the mailserver and spamassassin no other software 
is used besides the ifspamh script by James Grinter 
(http://www.gbnet.net/~jrg/qmail/ifspamh/)

Regards,
Arik


Re: Always add report headers

Posted by Craig Morrison <cr...@2cah.com>.
Arik Raffael Funke wrote:
> Nigel Frankcom wrote:
>> On Sat, 05 Aug 2006 14:08:45 +0200, Arik Raffael Funke
>> <ar...@gmx.de> wrote:
>>> how to I get spamd/spamc to always add the spamassassin report 
>>> headers? I.e. also to ham messages...
>>>
>>> I have the following in my local.cf and user_pref.cf but to no 
>>> apparent use:
>>>
>>> use_auto_whitelist 0
>>> use_bayes 0
>>> add_header all Report _REPORT_
>>> add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ 
>>> tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_
>>>
>>> I am using version 3.1.4.
>>
>> report_safe            1
> 
> That wasn't it either. As I understand the documentation this config 
> variable is supposed to attach the original message unmodified to a 
> spamassassin spam report message. This is not what I was looking for.
> 
> For me the usual X-Spam-Status headers suffice, but I also want them in 
> ham. As a call with "spamassassin ham.txt" would produce... just I want 
> them also with "less ham.txt | spamc".
> 
> I attach my local.cf below to avoid any uncertainties.
> 
> Thanks for the help.
> 
> - Arik
> 
> 
> 
> 
> -------- File: 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.
> #
> # Only a small subset of options are listed below
> #
> ###########################################################################
> 
> #   Add *****SPAM***** to the Subject header of spam e-mails
> #
> # rewrite_header Subject *****SPAM*****
> 
> 
> #   Save spam messages as a message/rfc822 MIME attachment instead of
> #   modifying the original message (0: off, 2: use text/plain instead)
> #
> # report_safe 1
> 
> 
> #   Set which networks or hosts are considered 'trusted' by your mail
> #   server (i.e. not spammers)
> #
> # trusted_networks 212.17.35.
> 
> 
> #   Set file-locking method (flock is not safe over NFS, but is faster)
> #
> # lock_method flock
> 
> 
> #   Set the threshold at which a message is considered spam (default: 5.0)
> #
> # required_score 5.0
> 
> 
> #   Use Bayesian classifier (default: 1)
> #
> use_bayes 0
> 
> 
> #   Bayesian classifier auto-learning (default: 1)
> #
> bayes_auto_learn 0
> 
> 
> #   Set headers which may provide inappropriate cues to the Bayesian
> #   classifier
> #
> # bayes_ignore_header X-Bogosity
> # bayes_ignore_header X-Spam-Flag
> # bayes_ignore_header X-Spam-Status
> 
> use_auto_whitelist 0
> use_bayes 0
> add_header all Report _REPORT_
> add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ tests=_TESTS_ 
> autolearn=_AUTOLEARN_ version=_VERSION_
> report_safe            1
> 
> 

The point is, who or what is calling spamassassin..

You have to have something in the mix of things that is screwing with 
your headers. Even with report_safe 0, SA adds the X-Spam* headers..

-- 
Craig

Re: Always add report headers

Posted by Arik Raffael Funke <ar...@gmx.de>.
Nigel Frankcom wrote:
> On Sat, 05 Aug 2006 14:08:45 +0200, Arik Raffael Funke
> <ar...@gmx.de> wrote:
>> how to I get spamd/spamc to always add the spamassassin report headers? 
>> I.e. also to ham messages...
>>
>> I have the following in my local.cf and user_pref.cf but to no apparent use:
>>
>> use_auto_whitelist 0
>> use_bayes 0
>> add_header all Report _REPORT_
>> add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ tests=_TESTS_ 
>> autolearn=_AUTOLEARN_ version=_VERSION_
>>
>> I am using version 3.1.4.
> 
> report_safe            1

That wasn't it either. As I understand the documentation this config 
variable is supposed to attach the original message unmodified to a 
spamassassin spam report message. This is not what I was looking for.

For me the usual X-Spam-Status headers suffice, but I also want them in 
ham. As a call with "spamassassin ham.txt" would produce... just I want 
them also with "less ham.txt | spamc".

I attach my local.cf below to avoid any uncertainties.

Thanks for the help.

- Arik




-------- File: 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.
#
# Only a small subset of options are listed below
#
###########################################################################

#   Add *****SPAM***** to the Subject header of spam e-mails
#
# rewrite_header Subject *****SPAM*****


#   Save spam messages as a message/rfc822 MIME attachment instead of
#   modifying the original message (0: off, 2: use text/plain instead)
#
# report_safe 1


#   Set which networks or hosts are considered 'trusted' by your mail
#   server (i.e. not spammers)
#
# trusted_networks 212.17.35.


#   Set file-locking method (flock is not safe over NFS, but is faster)
#
# lock_method flock


#   Set the threshold at which a message is considered spam (default: 5.0)
#
# required_score 5.0


#   Use Bayesian classifier (default: 1)
#
use_bayes 0


#   Bayesian classifier auto-learning (default: 1)
#
bayes_auto_learn 0


#   Set headers which may provide inappropriate cues to the Bayesian
#   classifier
#
# bayes_ignore_header X-Bogosity
# bayes_ignore_header X-Spam-Flag
# bayes_ignore_header X-Spam-Status

use_auto_whitelist 0
use_bayes 0
add_header all Report _REPORT_
add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ tests=_TESTS_ 
autolearn=_AUTOLEARN_ version=_VERSION_
report_safe            1


Re: Always add report headers

Posted by Nigel Frankcom <ni...@blue-canoe.net>.
On Sat, 05 Aug 2006 14:08:45 +0200, Arik Raffael Funke
<ar...@gmx.de> wrote:

>Hi,
>
>how to I get spamd/spamc to always add the spamassassin report headers? 
>I.e. also to ham messages...
>
>I have the following in my local.cf and user_pref.cf but to no apparent use:
>
>use_auto_whitelist 0
>use_bayes 0
>add_header all Report _REPORT_
>add_header all Status _YESNO_, hits=_HITS_ required=_REQD_ tests=_TESTS_ 
>autolearn=_AUTOLEARN_ version=_VERSION_
>
>I am using version 3.1.4.
>
>Cheers,
>Arik


report_safe            1