SA Bugzilla – Bug 2946
Add new test which matches the body of a message to a file of fixed strings
Last modified: 2004-02-26 15:07:26 UTC
I maintain a list of URLS which have been included in spam in the past. Currently I use procmail to route emails that match any of these fixed strings to a spam file. But really, what would be ideal is if I could change the score of a message based on if it matches one of the many fixed strings in an external file. Ie, I right now I use the following in procmailrc: :0HB: * ? formail -c | fgrep -sFi -f $HOME/qtrashlist likelyspambyurl but instead I'd like to be able to add to my user_prefs file: rawbody BADURLS eval:matchfile('/usr/me/qtrashlist', 'case-insensitive')
the only way I can think of to implement this would be a foreach/while loop that does a inefficient RE match per message, which is definitely not what you want to do. I would either generate a list of rules based on the strings you want and do it that way, or have the faster procmail method add a header via formail or something, and score that in SA.