I'm attempting to set up a system filter for exim4 which will act based upon spamassassin's score. Here is the gist of my filter:
# Exim filter
if (foranyaddress $recipients ($thisaddress contains "@mydomain.co.uk"))
and $h_X-Spam_score_int: is above 99
unseen mail to $thisaddress
subject "[ SPAM Witheld ] $h_subject:"
text "Message scored $h_X-Spam_score_int:"
seen save /var/mail/spam_hole
The above results in the mail being saved to /var/mail/spam_hole successfuly, but a new mail is not generated to the original recipient as intended, and the error Error in system filter: malformed numerical string ""
is written to my log.
The offending numerical string is the spam score in the line $h_X-Spam_score_int: is above 99
. I know this because if I change it to 100 is above 99
all is well. What is weird is that the exact same variable is being used in the body of the report message, and at that point is populated with the numerical value you'd expect, so why is it empty at the top of the file??