Initial commit spam/ham scripts for dovecot

This commit is contained in:
Tobias Herre 2023-11-03 08:57:19 +01:00
parent 1707d577ad
commit 1e2f36d7a1
4 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,2 @@
#!/bin/sh
exec /usr/bin/rspamc -h localhost:11334 learn_ham

View File

@ -0,0 +1,16 @@
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];
if environment :matches "imap.mailbox" "*" {
set "mailbox" "${1}";
}
if string "${mailbox}" "Trash" {
stop;
}
if environment :matches "imap.user" "*" {
set "username" "${1}";
}
pipe :copy "rspamd-learn-ham.sh" [ "${username}" ];

View File

@ -0,0 +1,3 @@
#!/bin/sh
exec /usr/bin/rspamc -h localhost:11334 learn_spam

View File

@ -0,0 +1,8 @@
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];
if environment :matches "imap.user" "*" {
set "username" "${1}";
}
pipe :copy "rspamd-learn-spam.sh" [ "${username}" ];