Hey folks,

   I'm playing around with writing some rules, something I've
never done before.  I'm not looking to do anything fancy, I just
wanted to learn how to do it.

   So, I picked one of my spams at total random, and wanted to
match on "e-shop.gr" in any of the headers.  The rule, I believe,
should look like this:

describe CJB_ESHOP_GR Contains reference to e-shop.gr
header CJB_ESHOP_GR ALL =~ /e-shop\.gr/i
score CJB_ESHOP_GR 0.01

   The efficiency and wisdom of matching against any headers aside,
is this correct so far?  I'm just thinking simple, I just want to
match the e-shop.gr string.

   Assuming that's OK, I moved on to creating the rule.  Now, I store
my user preferences in a PostgreSQL database, so this is where I'm
slightly unsure...  Can I simply add my rule above to my userprefs
table, one line per row?  Like so (pardon the line wrap):

db=> SELECT prefid, username, preference, value FROM userpref WHERE
username = 'me' AND preference LIKE '%CJB%' ORDER BY preference;
 prefid | username |      preference       |              value
--------+----------+-----------------------+-----------------------------
    450 | me    | describe CJB_ESHOP_GR | Contains reference to e-shop.gr
    452 | me    | header CJB_ESHOP_GR   | ALL =~ /e-shop\.gr/i
    453 | me    | score CJB_ESHOP_GR    | 0.01
(3 rows)

   Is this the correct way to do it?  Or do I *have* to add them to
local.cf or another such local file?

   I'm also unsure if I need to restart spamd to pick up on this new
rule, if indeed it can be stored in SQL - my other userprefs do not
need a restart, but rules I'm very unsure about.  I tried cat'ing a
sample spam and piping it to spamc (cat sample.txt | spamc), but
it did not hit my test rule.  And yes, e-shop.gr shows up in the
Received and From headers.  :)

   This is SpamAssassin 3.2.5 FYI.  Thanks, folks!

Benny


-- 
Whoever said that hell hath no fury like a women scorned never
owned a cat.
                                                  -- bash.org

Reply via email to