I would like to know if the following 2 things are possible, and if so, how?
1) be able to pass the current email score to the AI engine for it to take that into consideration when scoring. I'd like to be able to pass something like {message score} to the AI.
2) be able to insert a header into every single email, such as X-MSG-Score=8.4 where that is the actual score of the email.
thanks in advance!
I'm editing my message, because we found a SIEVE rule that can be used to add the message score to a header. The next post shows you the rule to use.
There is not currently a way to use the spam score in an AI prompt. I've added work items for both requests to our wishlist and they will be considered for future versions. The work item for adding the spam score is to make it easier to do.
In the case of inserting a header into a message with the message score, the closest you can get right now is a SIEVE rule that will indicate the range of the score, not the actual score. For example, something like this:
require ["securitygateway", "comparator-i;ascii-numeric","relational"];
if spamtotal :value "ge" :comparator "i;ascii-numeric" "15.0" {
addheader "X-SG-Spam-Score-Range" "15+";
} elsif spamtotal :value "ge" :comparator "i;ascii-numeric" "10.0" {
addheader "X-SG-Spam-Score-Range" "10-15";
} elsif spamtotal :value "ge" :comparator "i;ascii-numeric" "5.0" {
addheader "X-SG-Spam-Score-Range" "5-10";
} elsif spamtotal :value "ge" :comparator "i;ascii-numeric" "1.0" {
addheader "X-SG-Spam-Score-Range" "1-5";
} else {
addheader "X-SG-Spam-Score-Range" "0-1";
}
You can obvioulsy make the range as small as you want, but I would be careful about making the rule too large as it could slow down processing.
We found a way to get the message score added to a header.
require ["securitygateway","variables","regex"];
if spamtotal :matches "*" {
addheader "X-Spam-Score" "${1}";
}
If you don't want the score to include 6 decimel places use something like this:
require ["securitygateway","variables","regex"];
if spamtotal :matches "*.*????" {
addheader "X-SG-Spam-Score" "${1}.${2}";
}
@Arron Thank you very much for your reply.
I did implement this as a "Mail Global" Sieve script. A few emails have passed through and this is what is showing up in the header:
X-Spam-Score: 0.000000
Note: in the actual log file, these email scored 0.40, 8.0, 0.80, 0.60
I am not sure I have this configured properly, maybe I have the sieve script configured improperly.
Which rule are you using?
One of the early rules I posted to remove the extra decimels didn't work as expected.
If you don't want six decimel places make sure you are using this one.
require ["securitygateway","variables","regex"];
if spamtotal :matches "*.*????" {
addheader "X-SG-Spam-Score" "${1}.${2}";
}