Bug 1848 - "body" pattern test scans text in headers as well as the body
Summary: "body" pattern test scans text in headers as well as the body
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Rules (show other bugs)
Version: 2.43
Hardware: All other
: P5 normal
Target Milestone: 2.60
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-01 07:03 UTC by Quentin Campbell
Modified: 2003-05-24 11:45 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Quentin Campbell 2003-05-01 07:03:20 UTC
A "body" pattern test scans text in the message headers as well as the message 
body. This means that if you want to score a pattern differently depending on 
whether it appears in a Subject line (say) or the message body, you need to use 
metas which say:

   meta_1: if patterns match in "subject" but not "body" score X
   meta_2: if patterns match in "body" but not "subject" score Y

The documentation implies that a "headers" pattern test is restriced to the 
message headers while a "body" pattern test is restricted to the message body 
only. If they really did operate independently you would not need the metas 
described above.
Comment 1 Matt Kettler 2003-05-01 10:54:05 UTC
Subject: Re: [SAdev]  New: "body" pattern test scans text in
  headers as well as the body

This feature is also present in 2.53, but as I understand it, this is 
intentional.

Note that this is only true of the Subject: header. The To: header, for 
example, does not match body rules.

SA has always had a bit of a "special case" for the subject line. It treats 
it as part of the body for body checks.

You can get "separate" scoring by having a body rule and a subject "header" 
rule.

If the string is in the body, only the body rule will match and that score 
will be used.

If the string is in the subject both will match and the score of the 
subject rule can be used to modify the body-rule score up or down.

Comment 2 Antony Mawer 2003-05-01 13:19:08 UTC
Subject: Re: [SAdev]  New: "body" pattern test scans text in headers as well as the body 


> A "body" pattern test scans text in the message headers as well as the
> messag e body.

Actually, it includes *just* the Subject header in the body.   All
other headers are not included.

What test in particular is this an issue with?   So far, we've found
that this reduces complications a lot more than it causes.

Comment 3 Daniel Quinlan 2003-05-01 17:24:06 UTC
I think this is WORKSFORME.
Comment 4 Quentin Campbell 2003-05-02 00:57:21 UTC
Subject: RE:  "body" pattern test scans text in headers as well as the body

Thanks for the prompt reply. My response and comments are interpolated
in your message below.

Quentin
---
PHONE: +44 191 222 8209    Computing Service, University of Newcastle
FAX:   +44 191 222 8765    Newcastle upon Tyne, United Kingdom, NE1 7RU.
------------------------------------------------------------------------
"Any opinion expressed above is mine. The University can get its own." 


> -----Original Message-----
> From: bugzilla-daemon@hughes-family.org 
> [mailto:bugzilla-daemon@hughes-family.org] 
> Sent: 01 May 2003 21:19
> To: Q.G.Campbell@ncl.ac.uk
> Subject: [Bug 1848] "body" pattern test scans text in headers 
> as well as the body
> 
> 
> http://www.hughes-family.org/bugzilla/show_bug.cgi?id=1848
> 
> 
> 
> 
> 
> ------- Additional Comments From ajmawer@optusnet.com.au  
> 2003-05-01 13:19 -------
> Subject: Re: [SAdev]  New: "body" pattern test scans text in 
> headers as well as the body 
> 
> 
> > A "body" pattern test scans text in the message headers as 
> well as the 
> > messag e body.
> 
> Actually, it includes *just* the Subject header in the body.   All
> other headers are not included.

Then it would be helpful if the documentation made this clear! 

> 
> What test in particular is this an issue with?   So far, we've found
> that this reduces complications a lot more than it causes.

How does the behaviour of the body test reduce complications? I wish to
score certain strings higher when they appear in the Subject line than
when they appear in the body of the message (or possibly vice versa).

In order to achieve this I must now use metas because the "body" test
(in a local rule) will match and score a string already matched and
scored by the "Subject" test (in a standard SpamAssassin rule).

> 
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
> 

Comment 5 Theo Van Dinter 2003-05-24 19:45:51 UTC
I added a line to the body documentation explaining that the Subject header is
included.