spamassassin.exe: Spam Filtering Configuration on the Mailbox Level

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

  • enabling the use of server-wide spam filtering settings
  • setting the number of hits required to mark a letter as spam
  • adding mail addresses to black and white lists
  • marking mail subject as spam, deleting spam messages

 

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.

plesk bin 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:

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

or

plesk bin 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 Plesk server.

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

plesk bin spamassassin.exe --update-server -hits 5

--info-server

 

Displays the Spamassassin spam filter settings of the Plesk server.

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

plesk bin 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:

plesk bin spamassassin.exe --info JohnDoe@example.com

or

plesk bin 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:

plesk bin spamassassin.exe --help

or

plesk bin 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:

plesk bin spamassassin.exe -u JDoe@example.com -status true

To disable the Spamassassin filter on the Plesk server:

plesk bin 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:

plesk bin 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:

plesk bin spamassassin.exe --update JohnDoe@example.com -hits 3

-max-mail-size

<number>[B|K|M|G|T]

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.exe --update JohnDoe@example.com -max-mail-size 5M

-action

del|mark

Specifies how to deal with e-mail messages that are considered as spam:

  • del - removes messages
  • mark - marks them as spam according to defined settings

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

plesk bin spamassassin.exe --update JDoe@example.com -action del

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

plesk bin 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:

plesk bin spamassassin.exe --update JDoe@example.com -reject-spam true

-report-text

<string>

Specifies the spam detection alert text.

To specify the spam detection alert text for JDoe@example.com:

plesk bin spamassassin.exe --update JDoe@example.com -report-text "This message is spam"

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

plesk bin 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:

plesk bin 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:

plesk bin 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 :

plesk bin 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 :

plesk bin 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 :

plesk bin 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 :

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

 

Leave your feedback on this topic here

If you have questions or need support, please visit the Plesk forum or contact your hosting provider.
The comments below are for feedback on the documentation only. No timely answers or help will be provided.