spamassassin: Spam Filtering
The spamassassin utility is used to manage the Spamassassin spam
filter through CLI. By using this utility, you can perform the following
tasks:
enabling/disabling server-wide spam filtering
setting the criteria for automatic labeling of incoming messages as spam
enabling/disabling use of mail-name specific spam filtering criteria
adding mail messages to the Spamassassin’s black and white lists
marking mail subjects as spam
deleting spam automatically
inserting custom text into spam message subject lines automatically
Usage
spamassassin <command> [<mail_name>] [
<option_1> [<param>]
[<option_2> [<param>]]
... [<option_N> [<param>]]
]
Example
The following command enables Spamassassin filter on the mail account JDoe@example.com, enables the use of mail name-specific Spamassassin filter settings, sets the minimum score for marking email messages as spam to 3 and enables deleting spam messages automatically from the mailbox:
plesk bin spamassassin --update JDoe@example.com -status true -personal-conf true -reject-spam true -hits 3
Commands
Command |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Updates the Spamassassin spam filter settings on a Plesk mail account. |
To set the minimum score for marking email messages as spam and deleting them automatically for JDoe@example.com to 3: plesk bin spamassassin --update JDoe@example.com -hits 3 -reject-spam true or plesk bin spamassassin -u JDoe@example.com -hits 3 -reject-spam true |
|
Updates the Spamassassin spam filter settings on the Plesk server. |
To set the minimum score for marking email messages as spam for the Plesk server to 5: plesk bin spamassassin --update-server -hits 5 |
|
|
|
Displays the Spamassassin spam filter settings of a Plesk mail account. |
To view the Spamassassin spam filter settings of JDoe@example.com: plesk bin spamassassin --info JDoe@example.com or plesk bin spamassassin -i JDoe@example.com |
|
Displays the Spamassassin spam filter settings of the Plesk server. |
To view the Spamassassin spam filter settings for the Plesk server: plesk bin spamassassin --info-server |
|
|
Displays help on the use of this utility. |
To view the help info on the use of the spamassassin utility: plesk bin spamassassin --help |
Options
Option |
Parameter |
Description |
Example |
|---|---|---|---|
|
|
Enables/Disables the Spamassassin filter. |
To enable the Spamassassin filter on the mail account JDoe@example.com: plesk bin spamassassin -u JDoe@example.com -status true To disable the Spamassassin filter on the Plesk server: ./spamassassin --update-server -status false |
|
|
Enables/Disables using mail name-specific (rather than server- wide) antispam filter settings for a mail account. |
To enable using mail name-specific Spamassassin filter settings on JDoe@example.com: plesk bin spamassassin -u JDoe@example.com -personal-conf true |
|
|
Specifies the minimum score for a mail message to be marked as spam. |
To set the minimum score for marking mail messages as spam for JDoe@example.com to 3: plesk bin spamassassin --update JDoe@example.com -hits 3 |
|
|
Specifies e-mail message size. All messages that exceed the specified size are not processed by spam filter. |
To set the spam filter for JohnDoe@example.com to skip messages larger than 5 megabytes: plesk bin spamassassin --update JohnDoe@example.com -max-mail-size 5M |
|
|
Specifies how to deal with e-mail messages that are considered as spam:
|
To enable deleting spam messages automatically for JDoe@example.com: plesk bin spamassassin --update JDoe@example.com -action del |
|
|
Specifies the maximum number of simultaneously running
|
To set the maximum number of simultaneously running plesk bin spamassassin --update-server -max-proc 4 |
|
|
Enables/Disables subject lines automatic modification for messages marked as spam. |
To enable subject lines automatic modification for spam
messages and to specify the text to be inserted in the
beginning of the subject line to “***SPAM**
Score:* plesk bin spamassassin -u JDoe@example.com -modify-subj true -modify-subj-text "***SPAM*** Score: _SCORE_ :" |
|
|
Specifies the text to be inserted in the beginning of a subject line for messages marked as spam. Type |
|
|
|
Enables/Disables deleting spam messages automatically. |
To enable deleting spam messages automatically for JDoe@example.com: plesk bin spamassassin --update JDoe@example.com -reject-spam true |
|
|
Adds/Deletes mail patterns to/from the Spamassassin black list; enables/disables email patterns in the Spamassassin black list. The |
To add e-mail patterns *jane@example.com and ???Doe@.example.net* to the Spamassassin’s black list for JDoe@example.com: plesk bin spamassassin --update JDoe@example.com -blacklist add:*jane@example.com,???user@*.example.net |
|
|
Adds email patterns to or deletes them from the Spamassassin white list. Enables or disables email patterns in the Spamassassin white list. The |
To add e-mail patterns *jane@example.com to the Spamassassin’s white list of the server: plesk bin spamassassin --update-server -whitelist add:*jane@example.com |
* Non-ASCII characters are not allowed on the left of the @ sign in
the e-mail pattern. E-mail patterns can include the “*” and “?” wildcard
characters (for example, *@domain.com, user?@*.com). Non-ASCII parts of
domain names must not contain wildcard characters.