Utility script for rspamd spam and ham training.
The rspamd-learn-helper
is a utility script designed to streamline the training process for SPAM and HAM filters in the rspamd email filtering system. It provides an easy and automated way to enhance the effectiveness of rspamd's spam detection by allowing users to actively contribute to the training process.
How it Works:
- Users create specific folders such as ".TrainingSpam" and ".TrainingHam" in their mail directories.
- The script searches for these user-defined training folders within specified directories.
- Upon finding a training folder, the script executes the appropriate
rspamc learn
command, training rspamd for improved spam detection.
Key Features:
- User Contribution: Any mail user can contribute to the improvement of spam filtering by creating designated training folders.
- Automated Training: The script automates the training process, reducing the manual effort required to enhance rspamd's filter accuracy.
- Flexible Configuration: Easily configure and customize the script to fit your mail server's directory structure.
Before using the script, ensure that the following prerequisites are met:
- rspamd is installed on your system.
- The
rspamc
command-line utility is available.
-
Clone the repository to your local machine:
git clone https://github.com/filipnet/rspamd-learn-helper.git
-
Change into the project directory:
cd rspamd-learn-helper
-
Ensure the script has execute permissions:
chmod +x rspamd-learn-helper.sh
-
Run the script with the following command:
./rspamd-learn-helper.sh
-
The script will check if rspamd and rspamc are installed. If not, it will display an error message and exit.
-
If rspamd and rspamc are installed, the script will proceeding to search for training folders in user directories.
-
The script will then display information about any found training folders, outputting in yellow. It will also execute the appropriate
rspamc learn
command for each found folder.
For automated training, consider scheduling the script as a recurring task using tools like cron.
Example of running the script every day at 3 AM:
0 3 * * * /path/to/rspamd-learn-helper/rspamd-learn-helper.sh >/dev/null 2>&1
Contributions to this project are welcome! Whether you want to add features, fix bugs, or improve documentation, feel free to submit a pull request.
This project is licensed under the BSD 3-Clause "New" or "Revised" License, take a look at LICENSE for details.