However, before you enable it, you should know that this is disabled by default for security reasons. If you add the allow_user_rules option to your local.cf you can get spamd to honor them. Note: if you use spamd, rules placed in user_prefs will be IGNORED by default. Even if you do have a site-wide configuration, user_prefs may be useful to you by allowing you to add rules to another user account's user_prefs and test them using the command line prior to adding them to your local.cf. If you run SA from a sendmail milter, the only user_prefs that will be used is the one for the user sendmail runs as (usually root). Bear in mind that this is the user that executes SA, not the user who the mail is addressed To. ~/.spamassassin/user_prefs is best if you want to have a rule only run when a particular user runs SA. Rules placed here get applied no matter what user invokes SpamAssassin. etc/mail/spamassassin/local.cf is the place of choice for site-wide application of a rule. And your choice of place depends on how your copy of SpamAssassin is set up, and what you want the rules to do: So where do you put your rules if not in /usr/share/spamassassin? Well, there's two places. (ie: if there's a typo-fix in CVS, you might edit your. I'd only put changes in those files if it's a temporary fix for a bug in a rule that you expect will be fixed in the next version of SA. All your hard work and customization will be lost. When you upgrade SA (and you should do so somewhat regularly), all the existing rules in /usr/share/spamassassin will be deleted and replaced by the new default ruleset. Where to add themīefore we start writing rules, I have a warning for you. Whitelists, blacklists and tweaking scores of the default rules can help, but might not be sufficient in all cases. If the typical kinds of email coming to your network are significantly different than those used in the corpus, you may get a lot of false positives or false negatives. Since custom rules are generally not needed, why would you want to use some? Well, the default SpamAssassin ruleset is tuned to a somewhat generic sampling of mail that comes from the corpus submitters. You should realize that this guide is covering material that should be treated as intermediate to advanced configuration, not something you do 2 days after you manage to get SA working for the first time. I've tried to keep this guide very simple, and perhaps to a degree that makes it seem too easy. This guide also assumes you're relatively familiar with basic SpamAssassin configuration options, such as using blacklist_from and whitelist_to. Most sites run just fine with the default ruleset and no custom rules at all. Custom rules are really more for tweaking SpamAssassin to better suit your personal email, and isn't something you generally need to worry about at the start. If you don't yet have SpamAssassin running, I'd suggest starting off with the default ruleset. Why you don't need custom rulesįirst, this guide assumes you're already familiar with SpamAssassin and already have a working setup. This was originally written by MattKettler. This is a straightforward guide to writing your own add-on rules for SpamAssassin.
0 Comments
Leave a Reply. |