[Dovecot] sieve rules processing

Nikita Koshikov koshikov at gmail.com
Thu Jul 30 10:58:48 EEST 2009


On Thu, 30 Jul 2009 01:29:26 +0200
Stephan Bosch <stephan at rename-it.nl> wrote:

Thanks for your reply, Stephan.

> I am not exactly sure what you mean. Why are you providing an explicit 
> keep command when you want to sort the message further? I would think 
> the following example script does what you need:
> 
Without keep action - mail just redirected to specified mailbox, but it doesn't stores into my inbox.

> ==
> require "fileinto";
> require "copy";
> 
> # Temporary rule
> if true {
> 	# Forward a copy of all messages to gmail account
> 	redirect :copy "koshikov at gmail.com";
> }
> 
> # File spam into spam folder and stop further processing
> if header :contains "X-spam" "yes" {
> 	fileinto "Spam";
> 	stop;
> }
> 
> # Mailing list
> if header :contains "list-id" "ietf-mta-filters.imc.org" {
> 	fileinto "Lists.Sieve";
> }
> 
> # Implicit keep will store message in INBOX if it was not
> # stored already by the fileinto commands above. The :copy
> # argument to the redirect command prevents that command
> # from cancelling the implicit keep action.
> ==
> 
> I hope this helps you along.
> 
This is my current rule list:

require ["fileinto","envelope","copy"];
# rule:[redirect]
if anyof (true)
{
    redirect :copy "alice at domain.com";
}
# rule:[Cron]
elsif anyof (header :contains "Subject" "Cron")
{
    fileinto "INBOX/Cron";
}
 
Here is the message's headers:
Return-path: <bob at domain.com>
Envelope-to: koshikov.n at domain.com
Delivery-date: Thu, 30 Jul 2009 10:29:04 +0300
Received: from [192.168.1.160]
    by mail.domain.com with ESMTPSA (TLSv1:AES256-SHA:256) id 1MWQ4W-0007bH-38
    (envelope-from <bob at domain.com>)
    for koshikov.n at domain.com; Thu, 30 Jul 2009 10:29:04 +0300
Message-ID: <4A714B09.9030704 at domain.com>
Date: Thu, 30 Jul 2009 10:26:01 +0300
From: "bob at domain.com" <bob at domain.com>
User-Agent: Thunderbird 2.0.0.22 (X11/20090605)
MIME-Version: 1.0
To: =?UTF-8?B?0JrQvtGI0LjQutC+0LIg0J3QuNC60LjRgtCw?=
 <koshikov.n at domain.com>
Subject: Cron
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

test

But this mail save into INBOX, for user koshikov.n at domain.com, (the second rule is not working), in logs I have:
Jul 30 10:29:04 deliver(koshikov.n at domain.com): Info: sieve: msgid=<4A714B09.9030704 at domain.com>: forwarded to <alice at domain.com>
Jul 30 10:29:04 deliver(koshikov.n at domain.com): Info: sieve: msgid=<4A714B09.9030704 at domain.com>: stored mail into mailbox 'INBOX'
Jul 30 10:29:04 deliver(alice at domain.com): Info: sieve: msgid=<4A714B09.9030704 at domain.com>: stored mail into mailbox 'INBOX'

So :copy acting for me like "keep". Do you have any ideas, why this might happen ?

> Regards,
> 
> -- 
> Stephan Bosch
> stephan at rename-it.nl


More information about the dovecot mailing list