SA Bugzilla – Bug 189
Getting a list of symbols of tests hit with spamd
Last modified: 2002-06-15 03:58:08 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.
Created attachment 48 [details] Patch to provide SYMBOLS command in spamd
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.
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?
Created attachment 50 [details] Updated patch to spamd.raw moving symbols to body
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.
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.
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.
Ok, all (SYMBOLS and REPORT) committed now to CVS -- now we just need doc updates in the README.
*** Bug 154 has been marked as a duplicate of this bug. ***
Ok, cheap docs committed. Should be better, but people can read the code. Will update maybe when I implement SYMBOLS and REPORT in spamc.