mailcow user sieve forward all emails then filter into folders
Posted: Mon May 18, 2026 3:24 pm
forward all emails to backup@example.com
move emails from a wildcard domain into a folder.
user sieve location
move emails from a wildcard domain into a folder.
user sieve location
Code: Select all
/var/lib/docker/volumes/mailcowdockerized_vmail-vol-1/_data/[domain]/[username]/sieve/sogo.sieve
Code: Select all
require ["fileinto"];
# Backup every incoming message
redirect "backup@example.com";
# move all emails from the following domains into FOLDER1
if address :domain :is "from" [
"EXAMPLE.com.,
"EXAMPLE1.com",
"EXAMPLE2.com",
"EXAMPLE3.com"
] {
fileinto "FOLDER1";
stop;
}
# move all emails from the following domains into FOLDER2
if address :domain :is "from" "ANOTHERDOMAIN.com" {
fileinto "FOLDER2";
stop;
}
# move all emails from the following domains into FOLDER3
if address :domain :is "from" "YET-ANOTHERDOMAIN.com" {
fileinto "FOLDER3";
stop;
}