Had another go on this problem and after reading up quite some stuff about Seive, my final solution looks like that:
if header :contains "X-Spam-Flag" "YES" {
fileinto "Junk";
}
# header :contains "X-Moo-Tag" "YES"
set :lower :upperfirst "tag" "${1}";
if mailboxexists "INBOX/${tag}" {
fileinto "INBOX/${tag}";
} else {
fileinto :create "INBOX/${tag}";
}
}
if duplicate {
discard;
stop;
}
In my opinion, the header “X-Moo-Tag” never gets set by Mailcow (see #)– so the clause (asking for it) fails and never triggers the whole creation/filing of the mail. Not sure, why the “X-Moo-Tag” was added to the clause.
I cleared up the use of the variable for the subaddressing tag, so all works now as expected.