fix: Move spam to mailbox associated to the \Junk special-use attribute (#3925)

Co-authored-by: Brennan Kinney <5098581+polarathene@users.noreply.github.com>
This commit is contained in:
Kirill Kirilenko 2024-03-07 01:13:22 +03:00 committed by GitHub
parent e21e5e0490
commit 3649699197
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 43 additions and 11 deletions

View file

@ -304,11 +304,11 @@ function _setup_spam_to_junk() {
_log 'debug' 'Spam emails will be moved to the Junk folder'
mkdir -p /usr/lib/dovecot/sieve-global/after/
cat >/usr/lib/dovecot/sieve-global/after/spam_to_junk.sieve << EOF
require ["fileinto","mailbox"];
require ["fileinto","special-use"];
if anyof (header :contains "X-Spam-Flag" "YES",
header :contains "X-Spam" "Yes") {
fileinto "Junk";
fileinto :specialuse "\\\\Junk" "Junk";
}
EOF
sievec /usr/lib/dovecot/sieve-global/after/spam_to_junk.sieve