Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
SpamAssassin: A practical guide to integration and configuration

You're reading from  SpamAssassin: A practical guide to integration and configuration

Product type Book
Published in Sep 2004
Publisher Packt
ISBN-13 9781904811121
Pages 240 pages
Edition 1st Edition
Languages

Table of Contents (24) Chapters

SpamAssassin
Credits
About the Author
About the Reviewers
1. Introduction
1. Introducing Spam 2. Spam and Anti-Spam Techniques 3. Open Relays 4. Protecting Email Addresses 5. Detecting Spam 6. Installing SpamAssassin 7. Configuration Files 8. Using SpamAssassin 9. Bayesian Filtering 10. Look and Feel 11. Network Tests 12. Rules 13. Improving Filtering 14. Performance 15. Housekeeping and Reporting 16. Building an Anti-Spam Gateway 17. Email Clients 18. Choosing Other Spam Tools Glossary

Chapter 7. Configuration Files

SpamAssassin uses a number of configuration files and directories. These configuration files specify rules that are used by SpamAssassin to filter spam. The configuration files are distributed across various directories, which are different for standard, site-wide, and user-specific settings. In the following sections, we will discuss the configuration files associated with SpamAssassin.

Configuration Files

The configuration files for standard, site-wide, and user-specific settings are saved in different directories as follows:

  • Standard configuration settings are stored in /usr/share/spamassassin/

  • Site-wide customizations and settings are stored in /etc/mail/spamassassin/

  • User-specific settings are stored in ~/.spamassassin/

Standard Configuration

Standard configuration settings for SpamAssassin are contained in the files that SpamAssassin installs at /usr/share/spamassassin/. This includes default settings for all SpamAssassin features and a set of standard...

Configuration Files


The configuration files for standard, site-wide, and user-specific settings are saved in different directories as follows:

  • Standard configuration settings are stored in /usr/share/spamassassin/

  • Site-wide customizations and settings are stored in /etc/mail/spamassassin/

  • User-specific settings are stored in ~/.spamassassin/

Standard Configuration

Standard configuration settings for SpamAssassin are contained in the files that SpamAssassin installs at /usr/share/spamassassin/. This includes default settings for all SpamAssassin features and a set of standard rules and scores. Settings in this directory might be overridden when SpamAssassin is upgraded, so the files in this directory should not be modified.

Site-Wide Configuration

Site-wide configuration settings are done in /etc/mail/spamassassin/. SpamAssassin reads every file with a name ending in .cf and processes it as a SpamAssassin configuration file. By convention, the file /etc/mail/spamassassin/local.cf is used for...

Rule Files


Standard rule files are placed in /usr/share/spamassassin/. There is a variety of files in this directory, and the files may change with different releases of SpamAssassin. Barring a few exceptions, names for rules files are generally of the form: nn_description.cf where nn is a number, for example 10 or 25, and description describes the type of rules, for example dnsbl_tests or bayes.

The rules installed by SpamAssassin are version-specific. Custom rules can be defined in files ending in .cf, and placed in the /etc/mail/spamassassin/ directory, or in ~/.spamassassin/user_prefs for user-specific rules.

Rules

SpamAssassin first reads all the files in /usr/share/spamassassin/ in alphanumerical order; 10_misc.cf will be read before 23_bayes.cf. SpamAssassin then reads all the .cf files in /etc/mail/spamassassin/, again in alphanumeric order. Finally, SpamAssassin reads ~user/.spamassassin/user_prefs. If a rule or score is defined in two files, then the setting in the last file read...

Summary


SpamAssassin has three levels of configuration: standard, site-level, and user-level. Configuration settings at user-level override those at a site-level, and those at site-level override the standard configuration. Files associated with each of these setting levels are stored in different directories.

Rules and scores are the main elements of SpamAssassin mail filtering. These rules are specified in the files mentioned earlier. They use regex to filter terms or expressions that are typical of spam. Each rule is associated with a positive or negative score. Scores are used to filter spam from ham.

lock icon The rest of the chapter is locked
You have been reading a chapter from
SpamAssassin: A practical guide to integration and configuration
Published in: Sep 2004 Publisher: Packt ISBN-13: 9781904811121
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}