Bug 1799 - REPORT effectively ignores local config
Summary: REPORT effectively ignores local config
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: 2.53
Hardware: All All
: P5 normal
Target Milestone: 2.54
Assignee: Justin Mason
URL:
Whiteboard:
Keywords: backport
Depends on: 1764
Blocks: 1802
  Show dependency tree
 
Reported: 2003-04-18 08:45 UTC by Sam Kalet
Modified: 2003-05-08 08:29 UTC (History)
0 users



Attachment Type Modified Status Actions Submitter/CLA Status
fix patch None Justin Mason [HasCLA]
proposed patch patch None Sam Kalet [NoCLA]
spamc now creates that line, wire protocol 2.4x compatible patch None Justin Mason [HasCLA]
doco fix patch None Justin Mason [HasCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Sam Kalet 2003-04-18 08:45:48 UTC
The report returned by spamd in response to the REPORT command ignores any
report customizations that are made in the cf files.  This was verified using
Ian Christian's spamd protocol test script.

The 2.53 spamd source uses $status->test_logs as opposed to $status->get_report
(in 2.43) to generate the report that is returned to the client.  This is right
around line 295 in the 2.53 spamd source.  Changing the 2.53 source to use
get_report instead of test_logs results in everything working as in 2.43 (where
report options set in local.cf are represented in the report returned by spamd).
Comment 1 Justin Mason 2003-04-22 00:02:46 UTC
Created attachment 909 [details]
fix
Comment 2 Justin Mason 2003-04-22 00:03:27 UTC
well spotted, thanks for the fix.
Comment 3 Theo Van Dinter 2003-04-22 05:10:07 UTC
OKAY: looks good to me. :)
Comment 4 Sam Kalet 2003-04-22 05:39:19 UTC
Created attachment 915 [details]
proposed patch
Comment 5 Sam Kalet 2003-04-22 05:41:51 UTC
I fixed this with the proposed patch that I attached, which removes the
score/thresh line.  Otherwise, you always get a score/thresh line in the report,
when it might not be desired in that format, or at all.
Comment 6 Justin Mason 2003-05-01 23:30:46 UTC
Sam, I've just checked in the first patch -- to use get_report() instead of
{test_logs}.  That's OK.

Also, your second patch is correct -- to match 2.4x, the report should NOT
include that line.  I don't know where that came from.  However, to do this in
2.54 would break compat with 2.50-3.  So we need buy-in from the other devs.  folks?
Comment 7 Sam Kalet 2003-05-02 10:40:11 UTC
It appears that the score/thresh line prepended to the report in 2.53 spamd is
in support of the -R and -r options to spamc.  The spamc man page indicates this
line always appears at the beginning of the report returned.  If I use spamc -R
against spamd with my patch applied, the line does not appear.  With the
original 2.53 spamd source it does.  It seems more appropriate that this line be
generated by spamc since spamc is not the only client of spamd.

I could try to work up a patch for spamc to correspond with my patch for spamd
to preserve the documented functionality of -R and -r for spamc.  Let me know if
that is the way that you want to go...
Comment 8 Theo Van Dinter 2003-05-07 05:44:13 UTC
I'd rather have incompatibility between major releases than bug-fix releases.
If this is really a bug, lets fix it in 2.60 so that 2.5x is consistent.

But I need to get this bug out of the way for 2.54.  So lets make a decision:
either things are ok now and we close the bug, or the issue needs to be resolved
and it'll be fixed in 2.60 which should get a new ticket.
Comment 9 Justin Mason 2003-05-07 09:55:41 UTC
OK, Sam, you're right -- I'll add some code to get spamc to generate that line,
it shouldn't be too tricky.  So the matrix will be:

2.4x: no -R/-r flags on spamc, REPORT in protocol gives just report, no hdr line
2.5[0-3]: -R/-r supported, -r and REPORT all give report+hdr line
2.54: -R/-r supported, -r gives report+hdr, REPORT gives just report a la 2.4x
2.60: -R/-r supported, -r gives report+hdr, REPORT gives just report a la 2.4x
Comment 10 Justin Mason 2003-05-07 09:56:00 UTC
taking bug
Comment 11 Justin Mason 2003-05-07 23:45:22 UTC
Created attachment 942 [details]
spamc now creates that line, wire protocol 2.4x compatible
Comment 12 Justin Mason 2003-05-07 23:48:17 UTC
okay, this now is:
patch 915: correct patch on spamd side
patch 942: correct patch on spamc side.

It implements what I mentioned in the last comment, ie. spamc adds the line and
the wire-protocol does not include it.  So it's fully 2.4x compatible, but breaks
compat with 2.50, 2.51, 2.52, and 2.53.  But IMO the behaviour in those releases
is a bug.

Dan, Theo, OKAYs?
Comment 13 Theo Van Dinter 2003-05-08 06:22:23 UTC
ISSUE: as stated before, I would like to have all 2.5x releases compatible with
one another unless this is a major enough bug that it warrants the
incompatibility.   I'd rather fix 2.60 and have it be incompatible with 2.5x. 
At least then we can say that as long as the minor version number (Major.Minor,
followed by bug-fix release #  (which we really ought to change into a x.y.z or
something)) is the same, spamc/spamd interoperate, but we don't guarantee
interoperability between major/minor versions.
Comment 14 Antony Mawer 2003-05-08 10:23:18 UTC
Subject: Re:  REPORT effectively ignores local config 


bugzilla-daemon@hughes-family.org said:

> ISSUE: as stated before, I would like to have all 2.5x releases
> compatible wi th one another unless this is a major enough bug that it
> warrants the incompatibility.   I'd rather fix 2.60 and have it be
> incompatible with 2.5x.
>  
> At least then we can say that as long as the minor version number
> (Major.Mino r, followed by bug-fix release #  (which we really ought to
> change into a x.y.z or something)) is the same, spamc/spamd
> interoperate, but we don't guarantee interoperability between
> major/minor versions.

See your point -- but there's another issue -- spamd wire-level
compatibility.  Currently (and with your suggestion above) 2.4x is
incompatible with 2.5x, and 2.5x would be incompatible with 2.6x. 

I suggest instead we regard this as a bug in 2.5[0123], so instead it's
"the correct format is what 2.4x, 2.54 and 2.6x use, 2.5[0123] were
buggy".

--j.

Comment 15 Justin Mason 2003-05-08 12:57:55 UTC
BTW, I think this needs a clearer summary matrix, so here it is.  "-R"/"-r"
refers to the spamc usage; REP is the "REPORT" verb in the protocol; RIFS is the
"REPORT_IFSPAM" verb in the protocol.   "spamheader" refers to the "0/5" line
used at top of the -r report in 2.5x/2.6x.

2.4x: -R does not exist, -r does not exist, REPORT is just report, RIFS is
report if spam or "" if not spam.

2.5[0123]: -R is spamheader+report, -r is spamheader+report if spam or "" if not
spam, REPORT is spamheader+report, RIFS is spamheader+report if spam or "" if
not spam.

2.54, Theo's suggestion: -R is spamheader+report, -r is spamheader+report if
spam or "" if not spam, REPORT is spamheader+report, RIFS is spamheader+report
if spam or "" if not spam.

2.54, my suggestion: -R is spamheader+report, -r is spamheader+report if spam or
"" if not spam, REPORT is just report, RIFS is just report if spam or "" if not
spam.

2.60: -R is spamheader+report, -r is spamheader+report if spam or "" if not
spam, REPORT is just report, RIFS is just report if spam or "" if not spam.

So to restate, the question is: should we (a) treat it as a bug and fix it for
2.4x/2.6x compatibility in 2.5x -- or (b) say "2.5x uses a different wire format".
Comment 16 Theo Van Dinter 2003-05-08 13:32:56 UTC
> So to restate, the question is: should we (a) treat it as a bug and fix it for
> 2.4x/2.6x compatibility in 2.5x -- or (b) say "2.5x uses a different wire
> format".

I say: if 2.5x works as it's supposed to with the current code, ignoring
non-2.5x versions, leave the code alone.

That said, if jm and quinlan agree it should change, have at it.  I can see the
"but it's broken in 2.5x because it's different" argument, I would just rather
set the precident that x.yq releases will be compatible with x.yz releases, but
not necessarily with different x or y values.
Comment 17 Justin Mason 2003-05-08 15:50:54 UTC
OK, after discussion, we've agreed on the following.
2.4x and 2.6x will do the "right thing" as discussed.  However the 2.5x
series will maintain internal compatibility, and will continue with
the current behaviour.  We will fix it to use get_report() instead of
the {test_logs} text, so the user's report text is included.

So -- devs -- we need OKAYs on patch 909 (the get_report() one) and a
forthcoming patch which fixes the documentation to properly reflect this.
Comment 18 Justin Mason 2003-05-08 15:51:11 UTC
Created attachment 952 [details]
doco fix
Comment 19 Theo Van Dinter 2003-05-08 15:57:41 UTC
OKAY: 952 looks fine. :)
Comment 20 Daniel Quinlan 2003-05-08 16:17:20 UTC
OKAY: documentation fix looks fine
Comment 21 Justin Mason 2003-05-08 16:29:09 UTC
ok!  2.5x documents it; 2.6x does what 2.4x did.  so fixed