Dovecot relevante Files hinzugefügt
This commit is contained in:
3
dovecot/20-imap.conf
Normal file
3
dovecot/20-imap.conf
Normal file
@ -0,0 +1,3 @@
|
||||
protocol imap {
|
||||
mail_plugins = $mail_plugins imap_sieve
|
||||
}
|
18
dovecot/90-plugin.conf
Normal file
18
dovecot/90-plugin.conf
Normal file
@ -0,0 +1,18 @@
|
||||
plugin {
|
||||
sieve_plugins = sieve_imapsieve sieve_extprograms
|
||||
|
||||
# From elsewhere to Spam folder or flag changed in Spam folder
|
||||
imapsieve_mailbox1_name = Junk
|
||||
imapsieve_mailbox1_causes = COPY FLAG
|
||||
imapsieve_mailbox1_before = file:/usr/local/etc/dovecot/sieve/report-spam.sieve
|
||||
|
||||
# From Spam folder to elsewhere
|
||||
imapsieve_mailbox2_name = *
|
||||
imapsieve_mailbox2_from = Junk
|
||||
imapsieve_mailbox2_causes = COPY
|
||||
imapsieve_mailbox2_before = file:/usr/local/etc/dovecot/sieve/report-ham.sieve
|
||||
|
||||
sieve_pipe_bin_dir = /private/bin
|
||||
|
||||
sieve_global_extensions = +vnd.dovecot.pipe
|
||||
}
|
11
dovecot/report-ham.sieve
Normal file
11
dovecot/report-ham.sieve
Normal file
@ -0,0 +1,11 @@
|
||||
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];
|
||||
|
||||
if environment :matches "imap.mailbox" "*" {
|
||||
set "mailbox" "${1}";
|
||||
}
|
||||
|
||||
if string "${mailbox}" [ "Trash", "train_ham", "train_prob", "train_spam" ] {
|
||||
stop;
|
||||
}
|
||||
|
||||
pipe :copy "sa-learn-ham.sh";
|
13
dovecot/report-spam.sieve
Normal file
13
dovecot/report-spam.sieve
Normal file
@ -0,0 +1,13 @@
|
||||
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "imap4flags"];
|
||||
|
||||
if environment :is "imap.cause" "COPY" {
|
||||
pipe :copy "sa-learn-spam.sh";
|
||||
}
|
||||
|
||||
# Catch replied or forwarded spam
|
||||
elsif anyof (allof (hasflag "\\Answered",
|
||||
environment :contains "imap.changedflags" "\\Answered"),
|
||||
allof (hasflag "$Forwarded",
|
||||
environment :contains "imap.changedflags" "$Forwarded")) {
|
||||
pipe :copy "sa-learn-spam.sh";
|
||||
}
|
Reference in New Issue
Block a user