In short - you can't.
Dovecot allow only global and per-user sieves.
before/default/after
sieves are global and applied to each message. If you are sure that you want to process all messages in the same way you have to set up the sieve_before
filter, not the default
. But there is a not well explained trap here.
sieve_before
may consist of number of rules. First matched rule will be applied and sieve processing will be stopped. If you want then to pass message to the user
sieve for additional filtering you have to add the verb keep
to the end of specific rule.
require "fileinto";
# rule:[some_domain]
if header :contains "From" "some.domain.tld"
{
fileinto "some_domain_tld";
keep;
}
elseif . . . . .
{
. . . . .
keep;
}
else
{
keep;
}
If keep
verb is omitted then sieve engine will treat that as implicit verb stop
and message wouldn't be passed to the user
's sieve.