Spam Filtering Configuration on the Mailbox Level: spamassassin.exe

The spamassassin.exe utility serves to manage spam filtering on the mail-account level. The utility allows the following operations:

 

Location

%plesk_cli%

Usage

spamassassin.exe <command> [<email>] [
<option 1> <param 1>[,<param 2>,…,<param n>]
[<option 2> <param 1>[,<param 2>,…,<param n>]] 
… [<option N> <param 1>[,<param 2>,…,<param n>]]
]

 

Example

The following command modifies the SpamAssassin configuration on JohnDoe@example.com to using server-wide settings, sets the number of hits sufficient to consider a letter as spam to 6, orders to delete spam, and puts the spam@sample.com email address to the black list.

>spamassassin.exe --update JohnDoe@example.com -server-conf true -hits 6 -action del -blacklist add:spam@sample.com

 

Commands

Command

Parameter

Description

Example

--update or -u

<email>

Updates the spam filter configuration for an existing email account.

Updates spam filter settings for John@example.com:

>spamassassin.exe --update John@example.com -hits 3 -action del -blacklist add:spam@sample.com

or

>spamassassin.exe -u John@example.com -hits 3 -action del -blacklist add:spam@sample.com

--update-server

 

Updates the Spamassassin spam filter settings on the Parallels Plesk Panel server.

To set the minimum score for marking email messages as spam for the Parallels Plesk Panel server to 5:

>spamassassin.exe --update-server -hits 5

--info-server

 

Displays the Spamassassin spam filter settings of the Parallels Plesk Panel server.

To view the Spamassassin spam filter settings for the Parallels Plesk Panel server:

>spamassassin.exe --info-server

--info or -i

<email>

Retrieves the spam filter settings for the specified mail account.

To retrieve spam filter settings for JohnDoe@example.com:

>spamassassin.exe --info JohnDoe@example.com

or

>spamassassin.exe -i JohnDoe@example.com

--help or -h

 

Displays help on the use of this utility.

To see the help info on the use of the spamassassin.exe utility:

>spamassassin.exe --help

or

>spamassassin.exe -h

 

Options

Option

Parameter

Description

Example

-status

true|false

Enables/Disables the Spamassassin service settings.

To enable the Spamassassin filter on the mail account JDoe@example.com:

>spamassassin.exe -u JDoe@example.com -status true

To disable the Spamassassin filter on the Parallels Plesk Panel server:

>spamassassin.exe --update-server -status false

-server-conf

true|false

Deprecated. Use --update-server -status.

 

-personal-conf

true|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:

>spamassassin.exe -u JDoe@example.com -personal-conf true

-hits

<number>

Specifies the number of hits that are enough to consider a letter as spam.

To set the number of hits required to mark a letter as spam for the JohnDoe@example.com to 3:

>spamassassin.exe --update JohnDoe@example.com -hits 3

-max-proc

<1|2|3|4|5>

Specifies the maximum number of simultaneously running spamd processes on server.

Note: Some versions on SpamAssassin do not support this option.

To set the maximum number of simultaneously running spamd processes on server to 4:

>spamassassin.exe --update-server -max-proc 4

-reject-spam

true|false

Enables/Disables deleting spam messages automatically.

To enable deleting spam messages automatically for JDoe@example.com:

>spamassassin --update JDoe@example.com -reject-spam true

-modify-subj

true|false

Allows/Prohibits modifying the subject of mail messages.

To allow mail subject modification and to mark the subject with the word "SPAM" for JohnDoe@example.com:

>spamassassin.exe --update JohnDoe@example.com -modify-subj true -modify-subj-text "SPAM"

-modify-subj-text

<string>

Modifies the text of email message's subject.

-blacklist

<add|del|enable|disable>:<pattern1>[,<pattern2>,[…]]

Configures patterns for the black list.

To add spam@sample.com to the black list of JohnDoe@example.com:

>spamassassin.exe --update JohnDoe@example.com -blacklist add:spam@sample.com,spam@example.com

-whitelist

<add|del|enable|disable>:<pattern1>[,<pattern2>,[…]]

Configures patterns for the white list.

To delete Jane@sample.com from the white list:

>spamassassin.exe --update JohnDoe@example.com -whitelist del:Jane@sample.com

-enable-filtering

true|false

Deprecated. Use -personal-conf instead.

 

-trusted-languages

<lang1;lang2;...>

Configures list of allowed languages.

The parameter must be a valid language code described in ISO-639-2.

To add Chinese to trusted languages of Jane@sample.com :

>spamassassin.exe --update Jane@example.com --trusted-languages zh

-trusted-locales

<lang1;lang2;...>

Configures list of allowed locales.

Allowed values:

en - Western character sets in general

ja - Japanese character sets

ko - Korean character sets

ru - Cyrillic character sets

th - Thai character sets

zh - Chinese (both simplified and traditional) character sets

To add Cyrillic to trusted locales of Jane@sample.com :

>spamassassin.exe --update Jane@example.com --trusted-locales ru

-trusted-locales

<lang1;lang2;...>

Configures list of allowed locales.

Allowed values:

en - Western character sets in general

ja - Japanese character sets

ko - Korean character sets

ru - Cyrillic character sets

th - Thai character sets

zh - Chinese (both simplified and traditional) character sets

To add Cyrillic to trusted locales of Jane@sample.com :

>spamassassin.exe --update Jane@example.com --trusted-locales ru

-trusted-networks

<ip1/mask1;ip2/mask2...>

Configures list of allowed IP addresses.

Use this option only with the --update command.

To add the 192.0.2.0 - 192.0.2.255 address range to trusted IPs of Jane@sample.com :

>spamassassin.exe --update Jane@example.com --trusted-networks 192.0.2/24