mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
Add two sieve scripts for spam/ham learning. When the user moves a mail from anywhere to junk, or from junk to anywhere (except for trash) the mail is piped into the respective rspamc learn_spam/learn_ham command. The rspamc command is run as the mail user and the command requires that the user can connect to localhost:11334. Because of that, add the mail user to the allowed users that can access protected services. The sievec compilation of the new scripts requre the dovecot-antispam package, so install it and increment the email version number. Closes: #2487 Imroves: #56 Tests done: 1. Apply the patches on an existing install 2. Confirm the firewall and the email app get updated 3. Move a mail from inbox to junk and confirm that rspamd statistics for "Learned" mails increment by one. 4. Move back the mail from junk to inbox and confirm the number increments again. 5. Move the mail to trash and confirm the script doesn't execute. 6. Repeat steps 3-5 with mail_debug = yes in /etc/dovecot/dovecot.conf and confirm the script esxecution further by reading the debug logs. [Sunil] - Split the configuration file 90-freedombox-sieve.conf into 90-freedombox-imap.conf and merge the remaining with 95-freedombox-sieve.conf. - These changes do not need dovecot-anitspam package. Remove it from packages list for the app. Signed-off-by: Benedek Nagy <contact@nbenedek.me> Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>