[SOLVED] Score as float in __SPAM_INFO__

Nov 14, 2019
36
2
28
34
Hello,

how do I get the the spam score as a float in __SPAM_INFO__?

It would be sufficient to write the float value in the mail header. How to do that?

To achieve the same thing for the syslog, I slightly modified /usr/share/perl5/PMG/RuleDB/Spam.pm:
Code:
sub analyze_spam {
    [...]
    my ($sa_score, $sa_max, $sa_scores, $sa_sumary, $list, $autolearn, $bayes, $loglist, $sa_score_float);
    [...]
    $sa_score_float = $sa_score;
    [...]
    syslog ('info', "%s: SA score=%s/%s time=%0.3f bayes=%s autolearn=%s hits=%s", $queue->{logid}, $sa_score_float, $sa_max, $queue->{ptime_spam}/1000.0, $bayes, $autolearn, $loglist);
Cedric
 
Last edited:
Why would you need that?

The rule system currently works on the integer part of the score - so I currently don't see the gain from that
 
sorry - did not want to push you to justify your question!

my intention was to understand where this info could be useful - and if this could be of use to more of our users (the we could implement it or accept patches).

so - to answer your question - the __SPAM_INFO__ variable gets filled in pmg-smtp-filter - you need to pass the sa_score_float from Spam.pm as field in the queue object - then you can use it there.
 
Glad that worked ! :)

please mark the thread as 'SOLVED' - this helps other users with a similar idea

Thanks!
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!