User Tools

Site Tools


linux:centos:email:dovecot:sieve:add-email-rule

Add sieve rule

Move spam mails to inbox Spam folder (and create it if not already exist)

Edit /etc/dovecot/sieve/default.sieve

require ["fileinto", "mailbox"];

if header :contains "X-Spam-Flag" "YES" {
    fileinto :create "INBOX.Spam";
    stop;
} 

Recompile sieve configuration:

sievec -D "/etc/dovecot/sieve/default.sieve"

Move emails with "Event alarm" subject to inbox EventAlarm folder

Edit /etc/dovecot/sieve/default.sieve

require ["fileinto", "mailbox"];

if header :contains "Subject" "Event alarm" {
    fileinto :create "INBOX.EventAlarm";
    stop;
}

Recompile sieve configuration:

sievec -D "/etc/dovecot/sieve/default.sieve"
linux/centos/email/dovecot/sieve/add-email-rule.txt · Last modified: 2023/07/04 19:36 by 127.0.0.1