Skip to content

SpamAssassin

"SpamAssassin" is a script project designed to analyze the content of messages for detecting spam. Messages detected as spam are then marked using a point-based method: the more points a message receives, the higher the probability that it is spam.

Local configuration of SpamAssassin

To apply a local configuration of SpamAssassin in your home directory, create a folder called ".spamassassin" and inside it a configuration file: "user_prefs".

Examples

To use the examples below, place them in: /usr/home/login/.spamassassin/user_prefs

Lowering the required score to 4 for a message to be considered spam:

required_score 4

Example SpamAssassin rules

Whitelist

The whitelist contains addresses that will never be marked as spam. The list may include single addresses [email protected] as well as all addresses for a domain *@domain.com.

Examples:

whitelist_from [email protected]
whitelist_from *@domain.com

Blacklist

The blacklist contains addresses that will always be rejected by the anti-spam system.
The list may include single addresses [email protected],
all addresses for a domain *@domain.com, or all subdomains *.domain.com.

Examples:

blacklist_from [email protected]
blacklist_from *@domain.com
blacklist_from *.domain.com

URL filtering

Filtering URLs in the content of a message. The following example blocks advertising content from URL: www.domain.com/ads/.
A message containing this URL will receive an additional 5 points in spam classification.

uri LOCAL_URI_EXAMPLE /www\.domain\.com\/ads\//
score LOCAL_URI_EXAMPLE 5

Message body filtering

A rule that searches the content of a message for the string "test". In this example, a message containing the word "test" will receive an additional 3 points in spam classification.

body LOCAL_DEMONSTRATION_RULE /test/
score LOCAL_DEMONSTRATION_RULE 3
describe LOCAL_DEMONSTRATION_RULE Test rule

See also

Category:Mail