On 01/18/2017 06:13 PM, Ken Johnson wrote:
Hi,
I would like to write a rule to compare the rDNS lookup of the sender's IP
address to a regular expression. I have written super simple URI rules for
/etc/spamassassin/local.cf (Debian Linux system) like this:
uri LOCAL_AWSURI /.*amazonaws\.com/
score LOCAL_AWSURI 2.6
describe LOCAL_AWSURI Links to site at amazonaws.com
which work as expected. But my Google searches for examples or discussion
must be the wrong search terms, as the search results are about other
topics, not the one I want.
Can someone provide an example or point me toward documentation of how to
write such a rule?
https://wiki.apache.org/spamassassin/UsingSpamAssassin
"How to write and test new rules"
Header rules
header BLAH Received =~ /\.blah\.tld\b/
rules using "ALL =~" may hog your SA
also, when possible avoid using .*
Your SA's setup rules should provide tons of samples of all kinds..