sieve-language

Saving mail into specific folder with Sieve


According to documentations,

if header :contains "To" "user@domain.net" {
    fileinto "archive/user_domain_net";
    stop;
}

this would work. The intention would be saving a mail into a hardcoded path if the mail comes to a specific hardcoded address. Any ideas?


Solution

  • Found it, had to use regex and brackets:

    if header :regex    ["To"] ["^user@domain\.net$"] {
        fileinto "archive.user_domain_net";
        stop;
    }