Sieve and Dovecot for sorting emails
September 03, 2024 —
Nico Cartron
As usual, writing this mostly for myself, as it took me a few minutes to remember how this worked :)
Dovecot configuration
Here's what I added in Dovecot's dovecot.conf
file:
# Support Sieve - Nico 2023-12-24
plugin {
sieve = ~/.dovecot.sieve
sieve_global_path = /usr/local/lib/dovecot/sieve/default.sieve
sieve_dir = ~/sieve
sieve_global_dir = /usr/local/lib/dovecot/sieve/default.sieve
}
Sieve configuration
In my case, it's located in /var/vmail/DOMAIN_NAME/MAILBOX_NAME/.dovecot.sieve
and contains:
require "fileinto";
# Spam
if header :contains "X-Spam-Flag" "YES" {
fileinto "Junk";
}
# Logs Servers
elsif address :is ["From"] "root@ks2.ncartron.org" {
fileinto "Servers";
}
Tags: IT