Overview
SpamAssassin is used to filter unwanted emails. Over time, spam patterns change, so you may need to train SpamAssassin to improve its accuracy.
Training SpamAssassin means teaching it which emails are spam and which are legitimate (ham) using real messages from your mailbox.
Training SpamAssassin means teaching it which emails are spam and which are legitimate (ham) using real messages from your mailbox.
Note:
⚠️Warning
Procedure
Step 1: Prepare Your Emails
- Log in to Webmail and prepare your mailboxes:
- Move unwanted emails to the Junk folder
- Keep legitimate emails in the Inbox
Step 2: Access the Server
You can access the server as the Webuzo user using one of the following methods:
Option 1: Using Webuzo Panel
Option 2: Using SSH
Connect to the server via SSH and switch to the Webuzo user:
su - USERNAME
You can access the server as the Webuzo user using one of the following methods:
Option 1: Using Webuzo Panel
- Log in to the Webuzo Enduser Panel
- Navigate to Terminal
- This will open a shell session as the Webuzo user
Option 2: Using SSH
Connect to the server via SSH and switch to the Webuzo user:
su - USERNAME
Step 3: Train SpamAssassin
After preparing your emails and accessing the server, you can train SpamAssassin using the sa-learn utility.
After preparing your emails and accessing the server, you can train SpamAssassin using the sa-learn utility.
- Train Spam (Junk Emails):-
sa-learn --spam /home/USERNAME/mail/DOMAIN/EMAIL/.Junk/{cur,new}
- Train Ham (Legitimate Emails):-
Training ham means teaching SpamAssassin to recognize legitimate emails so they are not marked as spam.
sa-learn --ham /home/USERNAME/mail/DOMAIN/EMAIL/{cur,new}
- Alternate Spam Folder:-
sa-learn --spam /home/USERNAME/mail/DOMAIN/EMAIL/.spam/{cur,new}
(Replace USERNAME with the Webuzo user’s username, DOMAIN with the domain name, and EMAIL with the email account name before running the commands.)
Note: