Mailing List Archive

Body tests include subject?
Is it just me or does SpamAssassin (2.63) include subject in body tests?
To check my suspicion I have created 2 test rules:

header TESTING123_SUBJ Subject =~ /testing123/i
score TESTING123_SUBJ 0.01
body TESTING123_BODY /testing123/i
score TESTING123_BODY 0.01

If I send myself an E-mail with "testing123" in a body only, it only
triggers TESTING123_BODY test - as expected. If on the other hand I send
myself an E-mail with "testing123" in the subject but not in a body, it
triggers both tests, like in the E-mail below.

Is it a bug, a feature or am I pipe dreaming?



>>From sgenchev@yahoo.com Thu Jan 29 16:52:05 2004
>Return-Path: <sgenchev@yahoo.com>
>Received: from spambox.garmin.com (10.1.0.27 [10.1.0.27]) by
dallas.garmin.com with SMTP (Microsoft Exchange Internet Mail Service
>Version 5.5.2653.13)
> id DZ0FL1DF; Thu, 29 Jan 2004 16:51:01 -0600
>Received: from localhost (spambox [127.0.0.1])
> by spambox.garmin.com (Postfix) with ESMTP id CB2503F3C
> for <sgenchev@garmin.com>; Thu, 29 Jan 2004 16:50:56 -0600 (CST)
>Received: from spambox.garmin.com ([127.0.0.1])
> by localhost (spambox [127.0.0.1]) (amavisd-new, port 10024) with ESMTP
> id 04139-02 for <sgenchev@garmin.com>; Thu, 29 Jan 2004 16:50:56 -0600
(CST)
>Received: from web10412.mail.yahoo.com
> (web10412.mail.yahoo.com [216.136.128.126]) by pompeii.garmin.com with
> SMTP id i0TMou7X001087 for <sgenchev@garmin.com>; Thu, 29 Jan 2004
> 16:50:56 -0600 (CST)
>Message-ID: <20040129225051.53345.qmail@web10412.mail.yahoo.com>
>Received: from [63.76.48.90] by web10412.mail.yahoo.com via HTTP; Thu, 29
Jan
> 2004 14:50:51 PST
>Date: Thu, 29 Jan 2004 14:50:51 -0800 (PST)
>From: Sergei Genchev <sgenchev@yahoo.com>
>Subject: testing123
>To: sgenchev@garmin.com
>MIME-Version: 1.0
>Content-Type: text/plain; charset="us-ascii"
>X-Spam-Status: No, hits=-4.9 tagged_above=-200.0 required=5.4
tests=BAYES_00,
> TESTING123_BODY, TESTING123_SUBJ
>X-Spam-Level:
>
>Hi
>
>__________________________________
>Do you Yahoo!?
>Yahoo! SiteBuilder - Free web site building tool. Try it!
>http://webhosting.yahoo.com/ps/sb/



-------------------------
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient. If you are not the intended recipient, please be aware that any disclosure, copying, distribution or use of this e-mail or any attachment is prohibited. If you have received this e-mail in error, please contact the sender and delete all copies.
Thank you for your cooperation
RE: Body tests include subject? [ In reply to ]
> From: Genchev, Sergei [mailto:Sergei.Genchev@garmin.com]
> ...
> Is it just me or does SpamAssassin (2.63) include subject in body tests?

Your use of the term "body tests" here begs the question. I believe by
default *all* headers are included in test (subject, from, received-by...)

> To check my suspicion I have created 2 test rules:
>
> header TESTING123_SUBJ Subject =~ /testing123/i
> score TESTING123_SUBJ 0.01
> body TESTING123_BODY /testing123/i
> score TESTING123_BODY 0.01
>
> If I send myself an E-mail with "testing123" in a body only, it only
> triggers TESTING123_BODY test - as expected. If on the other
> hand I send
> myself an E-mail with "testing123" in the subject but not in
> a body, it
> triggers both tests, like in the E-mail below.
>
> Is it a bug, a feature or am I pipe dreaming?

You can specify Subject in the rule as you have above.
If there is a corresponding way to specify the Body (Body =~ /.../) then it
must be construed as a feature. If there is not, it must be construed as a
design decision. I don't believe this can be considered a bug.

If the design does not allow for a Body =~ /.../ you might be able to work
around it as
/testing123/i && Subject !~ /testing123/i
or perhaps a feature request should be submitted to allow for a Body =~
/.../
RE: Body tests include subject? [ In reply to ]
> -----Original Message-----
> From: Genchev, Sergei [mailto:Sergei.Genchev@garmin.com]
> Sent: Tuesday, February 03, 2004 2:25 PM
> To: 'spamassassin-users@incubator.apache.org'
> Subject: Body tests include subject?
>
>
>
> Is it just me or does SpamAssassin (2.63) include subject in
> body tests?
> To check my suspicion I have created 2 test rules:
>
> header TESTING123_SUBJ Subject =~ /testing123/i
> score TESTING123_SUBJ 0.01
> body TESTING123_BODY /testing123/i
> score TESTING123_BODY 0.01
>
> If I send myself an E-mail with "testing123" in a body only, it only
> triggers TESTING123_BODY test - as expected. If on the other
> hand I send
> myself an E-mail with "testing123" in the subject but not in
> a body, it
> triggers both tests, like in the E-mail below.
>
> Is it a bug, a feature or am I pipe dreaming?
>

It is a feature. Body will also look at the subject :)

--Chris
Re: Body tests include subject? [ In reply to ]
On Tue, Feb 03, 2004 at 11:48:44AM -0800, Matthew.van.Eerde@hbinc.com wrote:
> Your use of the term "body tests" here begs the question. I believe by
> default *all* headers are included in test (subject, from, received-by...)

No, just the subject. It's in the docs, BTW.

--
Randomly Generated Tagline:
I think you didn't get a reply because you used the terms "correct" and
"proper", neither of which has much meaning in Perl culture. :-)
-- Larry Wall in <199706251602.JAA01786@wall.org>