SA Bugzilla – Bug 5753
Make the log_scan_result plugin call more useful
Last modified: 2019-10-02 11:17:48 UTC
A mail on the users list was asking about logging results to a database. I was going to say "use log_scan_result", except then I looked at the call in spamd: $spamtest->call_plugins("log_scan_result", { result => $log }); and $log is: my $log = sprintf("spamd: result: %s %2d - %s %s", $yorn, $score, $tests, join(",", @extra)); Which is great if all you care about is the score and the list of rules that hit, and you feel like parsing the data back out from a scalar ... I'd like to see several things happen: a) Send the variables separately. ie: $yorn, $score, $tests, @extra. b) Include the actual message. ie: $mail c) Perhaps send $status, like most other calls, as well or instead, and let the plugin figure out what to do via PMS. d) Send some spamd information, like check() time, $current_user, client IP, etc.
OH yes! +1 from me, the current call is far too basic.
feel free to add an additional call_plugins() hook; but log_scan_result uses a well-defined format, even if it *is* a scalar ;) see the POD: The 'result: ...' line for this scan. Format is as described at http://wiki.apache.org/spamassassin/SpamdSyslogFormat. there's plenty of additional comma-separated name=value metadata in that line, btw.
Closing old stale bug, original need is too vague and no one seemed to follow up anyway.