Add learning feature like in rspamd

patefoniq

Well-Known Member
Jan 7, 2019
75
13
48
45
Poland
syslink.pl
Hi,

in short.

Is there any possibility to add one feature like in rspamd? I mean manual learning from raw e-mail:

1603366191070.png
It's the best way to check if the rule works properly.
 
You can hook this with some scripts and configuration. Here's what I'm doing, working with Zimbra as backend email server :
  1. In Zimbra, there's always specials spam and ham users, where emails are fowarded when a user mark a mail as spam or as ham
  2. In Zimbra, I create an IMAP account for PMG, which has access to both the spam and ham accounts (their INBOX appear as IMAP folders)
  3. Now on PMG, add a script like this one : https://git.fws.fr/fws/ansible-roles/src/branch/master/roles/pmg/files/imap-sa-learn
The script will open the PMG imap account and feeds the baysian filtering with what's in there (either as spam, or as ham, based on the IMAP folder where the emails are). You just have to set the approriate env vars, and setup a cron job. Or a systemd service + timer (see https://git.fws.fr/fws/ansible-roles/src/branch/master/roles/pmg/templates/imap-sa-learn.service.j2 and https://git.fws.fr/fws/ansible-roles/src/branch/master/roles/pmg/templates/imap-sa-learn.timer.j2)

Hope it helps.
Regards, Daniel