One of my email addresses is apparently part of a spam database – and there linked to the wrong name “Nina Steiner”. So any mail that makes it through my spam filter and contains this name is definitely spam and should be marked as such.
However, with the Spamassassin integration, Plesk Onyx does not provide a feature that allows you to define your own rules for content analysis.
Spamassassin itself supports this feature, which is why I show how to use it on a Plesk managed system.
Plesk lists the following ressources for Spamassassin configuration:
Enable User Rules
By default, the so-called “User Rules” are deactivated in the Spamassassin configuration.
/etc/mail/spamassassin/local.cf add the following entry:
Add Filter Rule
/var/qmail/mailnames/<domain_name>/<mailbox>/.spamassassin/user_prefs add the following lines:
body NINASTEINER /Nina Steiner/i describe NINASTEINER Nina Steiner Spam score NINASTEINER 500.0
Although the file contains a warning
#DO NOT MODIFY THIS FILE BECAUSE IT WAS GENERATED AUTOMATICALLY, #SO ALL YOUR CHANGES WILL BE LOST THE NEXT TIME THE FILE IS GENERATED.
it is safe to modify and add your own user rules. Plesk does not overwrite the entire file when changes are made on the web interface, it only changes the individual configuration values.
Learn more about Body Rules in the Spamassassin Docs.
You should restart Spamassassin after editing both files:
service spamassassin restart
Check The Logs
You can check the mail log
/var/log/maillog to verify the functionality:
spamd: spamd: processing message <firstname.lastname@example.org> for <mailbox>@<domain_name>:30 spamd: spamd: identified spam (500.0/4.0) for <mailbox>@<domain_name>:30 in 1.5 seconds, 2094 bytes. spamd: spamd: result: Y 500 - HTML_MESSAGE,NINASTEINER,URIBL_BLOCKED scantime=1.5,size=2094,user=<mailbox>@<domain_name>,uid=30,required_score=4.0,rhost=::1,raddr=::1,rport=57806,mid=<email@example.com>,autolearn=no autolearn_force=no
Perfect, the Body Rule works well!