mailcow user sieve forward all emails then filter into folders

Post Reply
zemerdon
Site Admin
Posts: 362
Joined: Mon Jan 23, 2023 8:13 pm

mailcow user sieve forward all emails then filter into folders

Post by zemerdon »

forward all emails to backup@example.com
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;
}
Post Reply