Files
Wiki/mailserver/sieve.md
2023-06-19 22:01:20 +02:00

524 B

Sieve

Sieve rule to automatically sort mails by alias

This Sieve rule filters mails by the mail alias they were sent to. Specifically, it uses a custom suffix separated by a dot: .(.*) It automatically creates a directory for that alias and moves the mail there. Then it stops processing.

require ["fileinto","mailbox","regex","variables"];

if allof (header :regex "to" "^<name>.(.*)@<domain.tld>$")
{
        set :lower :upperfirst "target" "${1}";
        fileinto :create "${target}";
        stop;
}