On Thu, 30 Jul 2009 01:29:26 +0200 Stephan Bosch <stephan@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@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@domain.com"; } # rule:[Cron] elsif anyof (header :contains "Subject" "Cron") { fileinto "INBOX/Cron"; }
Here is the message's headers: Return-path: <bob@domain.com> Envelope-to: koshikov.n@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@domain.com>) for koshikov.n@domain.com; Thu, 30 Jul 2009 10:29:04 +0300 Message-ID: <4A714B09.9030704@domain.com> Date: Thu, 30 Jul 2009 10:26:01 +0300 From: "bob@domain.com" <bob@domain.com> User-Agent: Thunderbird 2.0.0.22 (X11/20090605) MIME-Version: 1.0 To: =?UTF-8?B?0JrQvtGI0LjQutC+0LIg0J3QuNC60LjRgtCw?= <koshikov.n@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@domain.com, (the second rule is not working), in logs I have: Jul 30 10:29:04 deliver(koshikov.n@domain.com): Info: sieve: msgid=<4A714B09.9030704@domain.com>: forwarded to <alice@domain.com> Jul 30 10:29:04 deliver(koshikov.n@domain.com): Info: sieve: msgid=<4A714B09.9030704@domain.com>: stored mail into mailbox 'INBOX' Jul 30 10:29:04 deliver(alice@domain.com): Info: sieve: msgid=<4A714B09.9030704@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@rename-it.nl