2019-06-01 19:53:24 +08:00
|
|
|
# global_sieve_after script
|
|
|
|
# global_sieve_before -> user sieve_before (mailcow UI) -> user sieve_after (mailcow UI) -> global_sieve_after
|
|
|
|
|
2017-03-02 18:23:23 +08:00
|
|
|
require "fileinto";
|
|
|
|
require "mailbox";
|
|
|
|
require "variables";
|
|
|
|
require "subaddress";
|
|
|
|
require "envelope";
|
2020-10-11 16:34:15 +08:00
|
|
|
require "duplicate";
|
2017-03-02 18:23:23 +08:00
|
|
|
|
|
|
|
if header :contains "X-Spam-Flag" "YES" {
|
|
|
|
fileinto "Junk";
|
|
|
|
}
|
|
|
|
|
|
|
|
if allof (
|
|
|
|
envelope :detail :matches "to" "*",
|
|
|
|
header :contains "X-Moo-Tag" "YES"
|
|
|
|
) {
|
2017-05-08 06:27:16 +08:00
|
|
|
set :lower :upperfirst "tag" "${1}";
|
|
|
|
if mailboxexists "INBOX/${1}" {
|
|
|
|
fileinto "INBOX/${1}";
|
|
|
|
} else {
|
|
|
|
fileinto :create "INBOX/${tag}";
|
|
|
|
}
|
2017-03-02 18:23:23 +08:00
|
|
|
}
|
2020-10-11 16:34:15 +08:00
|
|
|
|
|
|
|
if duplicate {
|
|
|
|
discard;
|
|
|
|
stop;
|
|
|
|
}
|