Where Does SpamAssassin Store Config and Bayes Data?
SpamAssassin splits config three ways: system rules, local.cf overrides, and per-user prefs with Bayes databases.
Last updated
SpamAssassin configuration lives in three layers, and knowing which one you are editing saves real confusion. Stock rules ship in a versioned directory owned by the package. Local overrides go in local.cf next to it. Individual users keep their own prefs and Bayes databases at home.
That layout explains most surprises. Custom rules vanish after updates when they were placed with stock files instead of local.cf. Per-user scores ignore the system file when a user_prefs entry overrides it. Check the later layers first when behavior disagrees with the config you just wrote.
Where SpamAssassin stores this, by platform
/etc/spamassassin/local.cf
System-wide config. Put custom scores and rules in local.cf, never in the versioned rules directory, or updates will overwrite them. Per-user ~/.spamassassin/user_prefs overrides these values.
~/.spamassassin/
Per-user prefs, allowlists, and the Bayes databases (bayes_seen, bayes_toks). Created on first use. Delete the bayes_* files with the filter stopped to reset learning.
Frequently asked questions
Where do I put custom SpamAssassin rules?
Edit local.cf and restart or reload the mail filter. Files under the versioned rules directory get replaced on every update, wiping custom edits.
How do I reset Bayes learning for one user?
Delete the bayes_seen, bayes_toks, and related files in ~/.spamassassin while the filter is stopped. Learning resumes from empty on next mail.
Notice an outdated path? Let us know.