I have a problem on a dovecot2 mail server with a sieve script I write. The script should automatically move mail coming from a mailing list to a folder (by list name, not list id)
require ["fileinto", "mailbox", "variables", "regex"];
if exists "list-id" {
if header :regex "list-id" "([a-zA-Z0-9][a-zA-Z0-9-_. ]+[a-zA-Z0-9.])" {
fileinto :create "${1}";
stop;
}
}
For a mail with the header
List-Id: RZ Monitoring <rz-monitoring.lists.example.com>
This script should move all mail to a folder "RZ Monitoring". But for some reason all mail is piling up in the inbox instead.
The script is getting executed and I have no errors in my logs so I must have made a mistake in the script itself.