Bug 2079 - X-Spam-Level does not show *** on very high scores
Summary: X-Spam-Level does not show *** on very high scores
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamassassin (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: Other other
: P5 normal
Target Milestone: 2.60
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-17 15:17 UTC by Marc Perkel
Modified: 2003-06-19 04:25 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
Patch to properly fold long headers patch None Duncan Findlay [HasCLA]
new proposed patch, same as Duncan's, but adds limit of 50 patch None Daniel Quinlan [HasCLA]
new patch, burning my time for something not even listed in the bug. :-( patch None Daniel Quinlan [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Perkel 2003-06-17 15:17:49 UTC
I don't know where the cut off is but X-Spam-Level: is blank on very high
scoring spam.
Comment 1 Daniel Quinlan 2003-06-17 15:55:42 UTC
Confirmed, moved to 2.60 milestone.

I was able to work around the problem by lowering the maximum stars from 100
to 71 or lower.  Changing both 100s in the STARS code to 71 fixes the problem
for very high scoring spam.  72 does not.  My test message has a score of 97.

I believe the source of the bug is due to the wrapping code so the problem
could affect other headers.

For a workaround, I would suggest a maximum value of 65 since that would
result in a maximum line length of 79 which is the advisable maximum.
(I don't know why a value of 71 works, though, since that does result in a line
length longer than 79, I'm just suggesting 65 for aesthetic reasons if we can't
use 100.)

For a real fix, someone will have to do more work.
Comment 2 Marc Perkel 2003-06-17 16:48:27 UTC
Subject: Re:  X-Spam-Level does not show *** on very high scores

I would be happy if it showed 65 stars for any score over 65.



Comment 3 Duncan Findlay 2003-06-17 18:10:11 UTC
Patch to fix this will be attaches, for review.

Now a large number of stars will appear as follows (lets see how bugzilla
mangles this....)

X-Spam-Level:(space)***********************************************************************(newline)
(tab)*****************************

There's also the possibility of forcing it to overflow, but I dont think this is
desired given that the user has asked for them to be folded.
Comment 4 Duncan Findlay 2003-06-17 18:10:59 UTC
Created attachment 1050 [details]
Patch to properly fold long headers
Comment 5 Theo Van Dinter 2003-06-17 18:54:40 UTC
Subject: Re: [SAdev]  X-Spam-Level does not show *** on very high scores

On Tue, Jun 17, 2003 at 06:10:11PM -0700, bugzilla-daemon@hughes-family.org wrote:
> Now a large number of stars will appear as follows (lets see how bugzilla
> mangles this....)
> 
> X-Spam-Level:(space)***********************************************************************(newline)
> (tab)*****************************
> 
> There's also the possibility of forcing it to overflow, but I dont think this is
> desired given that the user has asked for them to be folded.

Perhaps instead of limiting the # of stars to 100, we should choose
whatever number makes it fit on a single line?

Comment 6 Daniel Quinlan 2003-06-17 19:17:58 UTC
-0: instead of splitting on '!!', use something that can't appear in
headers like a null.  "\000" (must use double quotes), and maybe have
it complain (not particularly important unless you're paranoid) if for
some reason a null was already present in the header data.

Also, let's limit the stars to 65 characters.  If it's broken after 65, it's
not going to match anything usefully anyway.
Comment 7 Duncan Findlay 2003-06-17 19:49:59 UTC
Subject: Re: [SAdev]  X-Spam-Level does not show *** on very high scores

> -0: instead of splitting on '!!', use something that can't appear in
> headers like a null.  "\000" (must use double quotes), and maybe have
> it complain (not particularly important unless you're paranoid) if for
> some reason a null was already present in the header data.

It only splits on the first one, so "!!" is just as valid as any
other, providing "!!" doesn't occur in the header name, which it
can't. I also haven't investigated how Text::wrap would treat a \000.

> Also, let's limit the stars to 65 characters.  If it's broken after 65, it's
> not going to match anything usefully anyway.

65 is somewhat arbitrary, and we still run into trouble, if people
want stars in a header called
X-Spam-Number-Of-Stars-Representing-Score:

So maybe we should pick 50 or 60 or something.

Comment 8 Daniel Quinlan 2003-06-17 19:57:34 UTC
Subject: Re: [SAdev]  X-Spam-Level does not show *** on very high scores

bugzilla-daemon@hughes-family.org writes:

> It only splits on the first one, so "!!" is just as valid as any
> other, providing "!!" doesn't occur in the header name, which it
> can't. I also haven't investigated how Text::wrap would treat a \000.

Okay.
 
> 65 is somewhat arbitrary, and we still run into trouble, if people
> want stars in a header called

Ah, okay.  We could figure it out to come out to 78, but let's just use
50 and keep it simple.

Comment 9 Marc Perkel 2003-06-18 07:52:40 UTC
Subject: Re:  X-Spam-Level does not show *** on very high scores

The stars are useful to test the message in Exim for a specific number 
of stars (or greater) to do routing. I use two level spam tagging - 
spam-high and spam-low at 15 and 5 points. Since Exim isn't great for 
processing numbers I need to count stars to see if something is over 15 
or 20 or something like that.

I doubt that I will ever need to do a conditional on over 50 stars. So I 
think that if you capped the number of stars at anything over 50 that it 
would do the job for most people who use stars.



Comment 10 Theo Van Dinter 2003-06-18 11:10:10 UTC
-0: I'll ditto quinlan's comments.
Comment 11 Daniel Quinlan 2003-06-18 11:40:08 UTC
Created attachment 1053 [details]
new proposed patch, same as Duncan's, but adds limit of 50
Comment 12 Theo Van Dinter 2003-06-18 12:26:00 UTC
-0: !! is still in there, and there should be docs about the 50 char limit.
Comment 13 Theo Van Dinter 2003-06-18 12:58:20 UTC
-0: ok, I misread your statement about !!, which does make sense.  so now I
would just like to have some docs about 50 being the limit.
Comment 14 Theo Van Dinter 2003-06-18 17:47:05 UTC
+ _STARS(*)_        one * for each score point (use any character)

I would probably just change this to specify the max length.  Something like:

+ _STARS(*)_        one * (use any character) for each score point (up to 50)


with that change, +1 from me. :)
Comment 15 Daniel Quinlan 2003-06-19 01:29:21 UTC
Created attachment 1056 [details]
new patch, burning my time for something not even listed in the bug.  :-(
Comment 16 Theo Van Dinter 2003-06-19 10:43:00 UTC
just because the doc isn't in the initial bug, it's the right thing to do.

+1 for 1056, btw.

I'm going to consider this 3 +1s now since the patch is essentially duncf's (+1
duncf) with the doc modification (+1 quinlan), and I've +1ed it.

committed.
Comment 17 Daniel Quinlan 2003-06-19 12:25:58 UTC
> just because the doc isn't in the initial bug, it's the right thing to do.

I was accused in the past by a user of holding a bug hostage because I wouldn't
accept his patch unless he fixed an additional orthogonal problem.  In that
instance, he was right.  I've tried to avoid doing that since then.  I don't
want to see code review (which I believe is leading to better stability and
helping us be closer than otherwise to our schedule) head down that path.
Comment 18 Theo Van Dinter 2003-06-19 12:55:06 UTC
Subject: Re: [SAdev]  X-Spam-Level does not show *** on very high scores

On Thu, Jun 19, 2003 at 12:25:58PM -0700, bugzilla-daemon@hughes-family.org wrote:
> I was accused in the past by a user of holding a bug hostage because I wouldn't
> accept his patch unless he fixed an additional orthogonal problem.  In that
> instance, he was right.  I've tried to avoid doing that since then.  I don't
> want to see code review (which I believe is leading to better stability and
> helping us be closer than otherwise to our schedule) head down that path.

Sure.  But documenting the code we're about to put in place isn't exactly
orthogonal, even if the previous code didn't have similar documentation.

and it was a -0 instead of a -1, so I wasn't holding anything hostage.