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
How do I accomplish this? Is using a custom template for dovecot overriding other config for sieve? I mean, the ispconfig entry for plugins section in dovecot conf says: sieve_before=/var/vmail/%d/%n/.ispconfig-before.sieve so indeed, it grabs these settings from an ispconfig file per user. How do I override this globally then? Can I just add it, like: sieve_before=/var/vmail/%d/%n/.ispconfig-before.sieve /var/mail/globalmoveSpamtoJunk.sieve and put that entry in the plugins segment for a custom dovecot template or something? Also looked here: https://forum.howtoforge.com/thread...nk-directory-on-by-default.55801/#post-271750 but it doesn't provide a persistent template overriding ispconfig updates..
Copy the file /usr/local/ispconfig/server/conf/sieve_filter.master to /usr/local/ispconfig/server/conf-custom/sieve_filter.master and then edit /usr/local/ispconfig/server/conf-custom/sieve_filter.master and change it in any way you like. The newly created file will get used for any new or updated mailbox then.