Filter mailing lists with Dovecot Sieve

require ["fileinto", "variables"];

if header :matches "List-Post" "*<mailto:**@*.*.*>" {
  fileinto "INBOX.lists.${5}.${3}"; stop;
}

if header :matches "List-Post" "*<mailto:**@*.*>" {
  fileinto "INBOX.lists.${4}.${3}"; stop;
}

if header :matches "X-Mailing-List" "*@*.*.*" {
  fileinto "INBOX.lists.${3}.${1}"; stop;
}

if header :matches "X-Mailing-List" "*@*.*" {
  fileinto "INBOX.lists.${2}.${1}"; stop;
}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.