On Wed, 11 Jan 2017, Alan Hodgson wrote:

On Wednesday 11 January 2017 16:58:39 Michael B Allen wrote:
Is there a way to add a rule that simply matches specific key words?

For example, if someone actually names my product it's basically
guaranteed not to be spam. In this case, I want to just whitelist it
(or maybe apply -10 to the score).

https://wiki.apache.org/spamassassin/WritingRules

Add to /etc/spamassassin/local.cf (or your .spamassassin/user_prefs if
allow_user_rules 1)

Something like:

header __LOCAL_SUBJECT_PRODUCTS Subject =~ /(product1|product2|product3)/i
body __LOCAL_BODY_PRODUCTS /(product1|product2|product3)/i

meta LOCAL_WHITELIST_PRODUCTS ( __LOCAL_SUBJECT_PRODUCTS ||
__LOCAL_BODY_PRODUCTS)

That's more complex than needed. The message subject is automatically included in body rules, so you only need __LOCAL_BODY_PRODUCTS.

I will refrain from making more technical RE tuning suggestions... :)

score LOCAL_WHITELIST_PRODUCTS -10
describe LOCAL_WHITELIST_PRODUCTS Message names one of my products

Reload spamassassin if you modified local.cf.

--
 John Hardin KA7OHZ                    http://www.impsec.org/~jhardin/
 jhar...@impsec.org    FALaholic #11174     pgpk -a jhar...@impsec.org
 key: 0xB8732E79 -- 2D8C 34F4 6411 F507 136C  AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
  Your mouse has moved. Your Windows Operating System must be
  relicensed due to this hardware change. Please contact Microsoft
  to obtain a new activation key. If this hardware change results in
  added functionality you may be subject to additional license fees.
  Your system will now shut down. Thank you for choosing Microsoft.
-----------------------------------------------------------------------
 6 days until Benjamin Franklin's 311th Birthday

Reply via email to