Hello board, I tried to do exactly that: Mails with X-Spam-Flag = YES should automatically move to Junk folder. I created a file /etc/dovecot/sieve/spam-to-folder.sieve with this content: require "fileinto"; if header :contains "X-Spam-Flag" "YES" { fileinto "INBOX.Junk"; } and added it via sievec, then restarted dovecot. However, Spam mails are still stored in the inbox, instead of the junk folder. Any ideas? Regards Zero
You might try just "Junk" for the folder name (that's what the 'Move Spam Emails to Junk directory.' mailbox setting uses), and test adding a stop; after fileinto (maybe a later sieve script is simply moving it back to INBOX?) If still not working, make sure you have sieve_global_dir set in your dovecot config, and check the sieve log file to see if it indicates anything (I'm not sure where that'd be for a global script, just the user sieve log file, or maybe /var/log/mail.log ?).
if you're using ISPConfig, you can setup sieve rules directly there. In the mailfilter tab of your account there's even a checkbox for: "Move Spam Emails to Junk directory."
well, doing it directly with sieve config files also works... and you learn a lot more by doing it that way