You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ashceryth 5c1c01e0c7 Use the correct config for hamcmd (#2) 1 year ago
.gitignore Add oneshot mode update config and readme 2 years ago
LICENSE Initial commit 2 years ago
README.md Add oneshot mode update config and readme 2 years ago
inotify-spamlearn.cfg Add oneshot mode update config and readme 2 years ago
inotify-spamlearn.py Use the correct config for hamcmd (#2) 1 year ago
inotify-spamlearn.service Add oneshot mode update config and readme 2 years ago

README.md

inotify-spamlearn

Description

A companion to the Kopano Core kopano-spamd, which is included from Kopano Core 8.6 on.

The kopano-spamd detects spam/ham state changes and writes these to either /var/lib/kopano/spamd/spam or /var/lib/kopano/spamd/ham respectively.

These folders are used by inotify-spamlearn to expose these eml files to external tooling.

The kopano-spamd from Kopano Core git master can be found here.

Python modules required

  • logging
  • os
  • subprocess
  • configparser
  • inotify.adapters
  • threading

Basic installation

Configuration

  • Edit the inotify-spamlearn.cfg file if required.
  • Edit the inotify-speamlearn.service to reflect the username and group required for your spamlearn command.
  • Verify the provided /etc/kopano/spamd.cfg is correct for your setup e.g. check the sa_group.

Copying the files

sudo cp inotify-spamlearn.cfg /etc/kopano
sudo cp inotify-spamlearn.py /usr/local/sbin/
sudo cp inotify-spamlearn.service /etc/systemd/system

Enabling and starting

sudo systemctl enable inotify-spamlearn
sudo systemctl start inotify-spamlearn

Verify if it is running

In the default config all logging is to the console, so systemd takes care of it, use journalctl to read the logging.

sudo systemctl status inotify-spamlearn
sudo journalctl -u inotify-spamlearn -f