Book Image

SpamAssassin: A practical guide to integration and configuration

Book Image

SpamAssassin: A practical guide to integration and configuration

Overview of this book

As a busy administrator, you know Spam is a major distraction in todays network. The effects range from inappropriate content arriving in the mailboxes up to contact email addresses placed on a website being deluged with unsolicited mail, causing valid enquiries and sales leads to be lost and wasting employee time. The perception of the problem of spam is as big as the reality. In response to the growing problem of spam, a number of free and commercial applications and services have been developed to help network administrators and email users combat spam. Its up to you to choose and then get the most out of an antispam solution. Free to use, flexible, and effective, SpamAssassin has become the most popular open source antispam application. Its unique combination of power and flexibility make it the right choice. This book will now help you set up and optimize SpamAssassin for your network.
Table of Contents (24 chapters)
SpamAssassin
Credits
About the Author
About the Reviewers
Introduction
Glossary

Writing Rules


The least complex rules are the body and header rules. Meta rules are more complex and are described later in the chapter.

All rules must implement a Perl regex. If a rule is defined, it will be run unless its score is set to 0. The default score for a rule is 1.0. Rules beginning with T_ are test rules, and SpamAssassin gives a default score of 0.01 to these. Rule names should be 22 characters or less. By convention, rule names are in uppercase.

A rule must also have a description. The describe configuration directive is used for this.

Rules should be placed in a file with the extension .cf and placed in /etc/mail/spamassassin. Rules can only be defined for a user if allow_local_rules is set in /etc/mail/spamassassin/local.cf:

allow_local_rules 1

User-defined rules are placed in ~/.spamassassin/user_prefs. Rules can be developed using a user account. Once a rule is tested and scored, it can be moved to the site-wide configuration.

Rules can be written to search for single words...