Bug 5753 - Make the log_scan_result plugin call more useful
Summary: Make the log_scan_result plugin call more useful
Status: RESOLVED WORKSFORME
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Plugins (show other bugs)
Version: SVN Trunk (Latest Devel Version)
Hardware: Other other
: P5 enhancement
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-12-20 08:41 UTC by Theo Van Dinter
Modified: 2019-10-02 11:17 UTC (History)
1 user (show)



Attachment Type Modified Status Actions Submitter/CLA Status

Note You need to log in before you can comment on or make changes to this bug.
Description Theo Van Dinter 2007-12-20 08:41:24 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.
Comment 1 Michael Parker 2007-12-20 08:51:29 UTC
OH yes! +1 from me, the current call is far too basic.
Comment 2 Justin Mason 2007-12-20 08:53:50 UTC
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.
Comment 3 Henrik Krohns 2019-10-02 11:17:48 UTC
Closing old stale bug, original need is too vague and no one seemed to follow up anyway.