Bug 189 - Getting a list of symbols of tests hit with spamd
Summary: Getting a list of symbols of tests hit with spamd
Status: RESOLVED FIXED
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: spamc/spamd (show other bugs)
Version: 2.30CVS
Hardware: PC Linux
: P2 enhancement
Target Milestone: ---
Assignee: Craig Hughes
URL:
Whiteboard:
Keywords:
: 154 (view as bug list)
Depends on:
Blocks: 191
  Show dependency tree
 
Reported: 2002-04-05 02:07 UTC by Alan Ford
Modified: 2002-06-15 03:58 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status
Patch to provide SYMBOLS command in spamd patch None Alan Ford [NoCLA]
Updated patch to spamd.raw moving symbols to body patch None Craig Hughes [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Ford 2002-04-05 02:07:40 UTC
This patch adds a SYMBOLS command to spamd, an enhancement of the CHECK command,
to return the list of symbols that were hit on a particular mail.
Comment 1 Alan Ford 2002-04-05 02:08:26 UTC
Created attachment 48 [details]
Patch to provide SYMBOLS command in spamd
Comment 2 Craig Hughes 2002-04-05 08:36:20 UTC
Subject: Re:  Getting a list of symbols of tests hit with spamd

Alan, thanks for this.  Very useful for a few people I think.  Could you
please attach patches in the future though instead of the whole updated
script?  Otherwise it might be out of sync by the time I get to putting
it in CVS.  To generate a patch, do the following:

diff -u oldfile newfile > patchfile

Then send/attach the patchfile.

Comment 3 Craig Hughes 2002-04-05 10:49:44 UTC
Ithink that the symbols list should take the place of a body, and not be part 
of the SPAMD header block. ie should look something like:

SPAMD/1.1 EX_OK 0
Spam: True ; 17 / 5

FOO,BAR,BAZ

So I changed two lines in your patch:

-           print $status->get_names_of_tests_hit, "\r\n" if ($method 
eq "SYMBOLS");
-           print "\r\n";
+           print "\r\n";
+           print $status->get_names_of_tests_hit if ($method eq "SYMBOLS");

Sounds reasonable?
Comment 4 Craig Hughes 2002-04-05 10:54:44 UTC
Created attachment 50 [details]
Updated patch to spamd.raw moving symbols to body
Comment 5 Craig Hughes 2002-04-05 10:56:33 UTC
We also now need to update the documentation of the protocol to include this info.  Probably also useful to create a new enhancement ticket for spamc to be able to talk SYMBOLS -- I'll do that and have it depend on this.  But I don't think I'll mark this ticket fixed until we got docs.
Comment 6 Alan Ford 2002-04-05 11:00:21 UTC
Re your little changes:
Yes, I suppose so (in which case the prints within the if/else block do not need
to be changed as I had) but it still needs to end in \r\n since
get_names_of_tests_hit itself does not provide this.

I noticed another bug report asking to get a report. This could be easily added
by changing the regexp at the top to (CHECK|SYMBOLS|REPORT) and adding, after my
line ending in if ($method eq "SYMBOLS") :

print $status->get_report if ($method eq "REPORT")

At least, I am assuming that would work.
Comment 7 Craig Hughes 2002-04-05 21:17:32 UTC
Subject: Re:  Getting a list of symbols of tests hit with spamd

Yeah, that should work.  I'll mark the other as a dupe of this bug, and make the 
changes.  In the end, I did undo the changes to the original header lines and 
such -- see CVS for exactly what I did.  I didn't add a \r\n on the end, because 
it's not really needed is it?  I guess maybe for prettiness if you're runnign 
from netcat or something maybe...  And it'll be needed once the report is added 
in there I guess.

Comment 8 Craig Hughes 2002-04-06 11:32:30 UTC
Ok, all (SYMBOLS and REPORT) committed now to CVS -- now we just need doc
updates in the README.
Comment 9 Craig Hughes 2002-04-10 02:06:08 UTC
*** Bug 154 has been marked as a duplicate of this bug. ***
Comment 10 Craig Hughes 2002-04-10 02:37:45 UTC
Ok, cheap docs committed.  Should be better, but people can read the code.  Will
update maybe when I implement SYMBOLS and REPORT in spamc.