Custom SA rule per domain

Questions and answers about how to do stuff
Post Reply
peter.munnelly
Posts: 23
Joined: 25 Nov 2015 16:31

Custom SA rule per domain

Post by peter.munnelly »

Hi,

Is it possible to have custom rules for a specific domain and not for all domains that have been setup?
User avatar
pdwalker
Posts: 1583
Joined: 18 Mar 2015 09:16

Re: Custom SA rule per domain

Post by pdwalker »

Probably.

What do you want to do exactly?
peter.munnelly
Posts: 23
Joined: 25 Nov 2015 16:31

Re: Custom SA rule per domain

Post by peter.munnelly »

I want to create a custom rule that blocks any email where the header contains .rsvg.net, I can do this via the following SA rule.

header CONTAINS_RSGSV Received =~ /rsgsv\.net/i
score CONTAINS_RSGSV 10.0
describe CONTAINS_RSGSV rsgsv.net

What I want to do then is only have this rule be applied to email for domain.com and be ignored for all other domains.
User avatar
pdwalker
Posts: 1583
Joined: 18 Mar 2015 09:16

Re: Custom SA rule per domain

Post by pdwalker »

Yes, simple enough. Off the top of my head, I forget the syntax, but if you peruse the existing rules in /var/lib/spamassassin/3.004001/updates_spamassassin_org you should be able to find an example of an "AND" rule that you can use as a template

Oh, shawniversion has just posted an example here: viewtopic.php?f=14&t=2416 that you could adapt to your needs.
Post Reply