How to edit bad word filter in SpamAssassin?

Solution 1:

In SpamAssassin you can create rules that appends N score to the spam classification header after it's triggered.

It's up to yourself to set the threshold for when it's to be classified as spam, and what to do with it (delete, move to folder, forward?, etc).

If you want to move suspected spam mails to a specific folder I suspect you to hook it into your POP3/IMAP server (ex: dovecot), or POP3/IMAP client usage (ex: fetchmail + procmail).

Dovecot example using sieve scripts:

if header :contains "X-Spam-Level" "**********" { discard; stop; }

Ref: https://wiki2.dovecot.org/Pigeonhole/Sieve/Examples#Direct_filtering_using_message_header

Procmail rule to filter spam to SPAM folder (~/.procmailrc)

:0: * ^X-Spam-Status: Yes SPAM

Ref: https://www.cs.rutgers.edu/~watrous/procmail-spam.html

I hope this proves helpful.