Re: A little sieve help

Aaron Stone <aaron@serendipity.cx> Thu, 11 December 2008 02:04 UTC

Return-Path: <owner-ietf-mta-filters@mail.imc.org>
X-Original-To: ietfarch-sieve-archive-Aet6aiqu@core3.amsl.com
Delivered-To: ietfarch-sieve-archive-Aet6aiqu@core3.amsl.com
Received: from localhost (localhost [127.0.0.1]) by core3.amsl.com (Postfix) with ESMTP id 532FF3A6C0D for <ietfarch-sieve-archive-Aet6aiqu@core3.amsl.com>; Wed, 10 Dec 2008 18:04:05 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.322
X-Spam-Level:
X-Spam-Status: No, score=-2.322 tagged_above=-999 required=5 tests=[AWL=0.277, BAYES_00=-2.599]
Received: from mail.ietf.org ([64.170.98.32]) by localhost (core3.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UxPRCy3PJ1Sd for <ietfarch-sieve-archive-Aet6aiqu@core3.amsl.com>; Wed, 10 Dec 2008 18:04:04 -0800 (PST)
Received: from balder-227.proper.com (properopus-pt.tunnel.tserv3.fmt2.ipv6.he.net [IPv6:2001:470:1f04:392::2]) by core3.amsl.com (Postfix) with ESMTP id 090873A6900 for <sieve-archive-Aet6aiqu@ietf.org>; Wed, 10 Dec 2008 18:04:03 -0800 (PST)
Received: from balder-227.proper.com (localhost [127.0.0.1]) by balder-227.proper.com (8.14.2/8.14.2) with ESMTP id mBB1vv6v079857 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 10 Dec 2008 18:57:57 -0700 (MST) (envelope-from owner-ietf-mta-filters@mail.imc.org)
Received: (from majordom@localhost) by balder-227.proper.com (8.14.2/8.13.5/Submit) id mBB1vv4U079856; Wed, 10 Dec 2008 18:57:57 -0700 (MST) (envelope-from owner-ietf-mta-filters@mail.imc.org)
X-Authentication-Warning: balder-227.proper.com: majordom set sender to owner-ietf-mta-filters@mail.imc.org using -f
Received: from mail.serendipity.cx (serendipity.palo-alto.ca.us [66.92.2.87]) by balder-227.proper.com (8.14.2/8.14.2) with ESMTP id mBB1vjKx079847 for <ietf-mta-filters@imc.org>; Wed, 10 Dec 2008 18:57:56 -0700 (MST) (envelope-from aaron@serendipity.cx)
Received: from [172.16.1.34] (localhost [127.0.0.1]) by mail.serendipity.cx (Postfix) with ESMTP id 031C51F9E; Wed, 10 Dec 2008 18:01:44 -0800 (PST)
Subject: Re: A little sieve help
From: Aaron Stone <aaron@serendipity.cx>
To: Patrick Baldwin <Patrick.Baldwin@studsvik.com>
Cc: ietf-mta-filters@imc.org
In-Reply-To: <49404348.8090304@studsvik.com>
References: <49404348.8090304@studsvik.com>
Content-Type: text/plain
Date: Wed, 10 Dec 2008 17:53:30 -0800
Message-Id: <1228960410.29598.1672.camel@turtle>
Mime-Version: 1.0
X-Mailer: Evolution 2.24.2
Content-Transfer-Encoding: 7bit
Sender: owner-ietf-mta-filters@mail.imc.org
Precedence: bulk
List-Archive: <http://www.imc.org/ietf-mta-filters/mail-archive/>
List-ID: <ietf-mta-filters.imc.org>
List-Unsubscribe: <mailto:ietf-mta-filters-request@imc.org?body=unsubscribe>

This mailing list mostly works on Sieve as a standard, but a few user
questions now and then is good -- someone is using this stuff! ;-)

On Wed, 2008-12-10 at 17:31 -0500, Patrick Baldwin wrote:

[snip procmail script]

> In sieve, I was thinking something like:
> 
> require ["fileinto","regex","envelope"];
> 
> if address :is "To" "online" {
>   fileinto "online";
> } elsif address :is "To" "Support" { 
>   fileinto "Support";
}
> if address :is "From" "<ship address>" {
>   fileinto "SHIPMENTS";
> }

:matches might be what you want, rather than :is.

> redirect "<user name>@gmail.com";
> keep;
> 
> stop;

Stop is not needed at the end of the script, but doesn't hurt.

> 
> ...but I'm really not sure.  I also haven't figured out how to have sieve
> insert a header to avoid mail loops like I did with procmail.

libsieve doesn't support the editheader extension yet, RFC 5293. It's on
my todo list...

Aaron