A simple yet very useful perl script to generate rules for spamassasin¬†(linux spam filter) in order to create spam rules to block certain types of emails based on “email body content“.

The script was initially created by darxus [at] chaosreigns [dot]com. I have just adapted it a little bit according to my needs! Save the script bellow as saword.pl

The script syntax: echo “email body text” | perl saword.pl SPAMRULE
root@zira# echo "i am a virus" | perl sawordrule.pl SPAM_1 

It will generate a simple case insensitive spamassassin rule that can be added right into local.cf file. Restart spamd and you’re good to go. All emails that have the text “i am a virus” in their body text will be rejected!


About Author

I am a linux passionate and currently working as a Linux Senior System Administrator. I also am a freelancer and help people to complete different jobs. You can hire me on Freelancer.com

Leave A Reply

Get new posts by email: