Inconsistent filtering with debugging

Stephan Bosch stephan at rename-it.nl
Fri Mar 10 22:39:17 UTC 2023


Op 24-2-2023 om 14:03 schreef Christian Wolf:
> Hello,
>
> I have the problem, that I have a Postfix/Dovecot combination running 
> with Sieve activated. The sieve script is running in general as some 
> messages get filtered and moved to the appropriate folders.
>
> Now, I see that for the envelope filter, the behavior differs 
> depending if I am debugging the rules or if the mails are received in 
> a regular way.
>
> I have something like this:
>
> require "envelope";
>
> # ...
>
> if envelope :is "to" "foo at subdaomin.example.com" {
>     fileinto "INBOX.bar";
>     stop;
> }
>
> # ...
>
> The thing is if I call sieve-filter on the INBOX, I get the 
> information that the mail is to be moved to the appropriate folder. 
> However during delivery the mail is not moved there. Other rules in 
> the script are working so it is installed in general.
>
> Of course, I could send mails to the mail address for testing but I 
> have no clue on where to look for issues, especially as the "main 
> debugging tool" for the rules (sieve-filter) is strangely behaving 
> differently.
>
> The reason, I wanted to use the envelope was because the mails are 
> delivered to foo at subdomain.example.com. From there, some virtual 
> aliases are forwarded to a cental account bar at example.net using 
> postfix virtual aliases. Thus, the Delivered-To header is always 
> showing the value bar at example.net which is not suited for filtering.
>
> I could filter the Received headers but hoped for a more "high level" 
> solution.

You can fill in the envelope addresses using command line options (see 
man pages). If you don't, it will fill in some defaults based on the 
provided message.

You can debug the actual delivery by using the sieve_trace setting.

Regards,

Stephan.




More information about the dovecot mailing list