
From stephan@rename-it.nl  Sat Mar  9 03:10:08 2013
Return-Path: <stephan@rename-it.nl>
X-Original-To: sieve@ietfa.amsl.com
Delivered-To: sieve@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5DAB021F84C6 for <sieve@ietfa.amsl.com>; Sat,  9 Mar 2013 03:10:08 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.985
X-Spam-Level: 
X-Spam-Status: No, score=0.985 tagged_above=-999 required=5 tests=[BAYES_05=-1.11, HELO_EQ_NL=0.55, HOST_EQ_NL=1.545]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id msfdSBL25oN4 for <sieve@ietfa.amsl.com>; Sat,  9 Mar 2013 03:10:07 -0800 (PST)
Received: from drpepper.rename-it.nl (drpepper.rename-it.nl [217.119.238.16]) by ietfa.amsl.com (Postfix) with ESMTP id BEDD521F84E6 for <sieve@ietf.org>; Sat,  9 Mar 2013 03:10:06 -0800 (PST)
Received: from klara.student.utwente.nl ([130.89.162.218]:55094 helo=[10.168.3.2]) by drpepper.rename-it.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <stephan@rename-it.nl>) id 1UEHf0-00052A-I3 for sieve@ietf.org; Sat, 09 Mar 2013 12:10:00 +0100
Message-ID: <513B1839.3050202@rename-it.nl>
Date: Sat, 09 Mar 2013 12:08:41 +0100
From: Stephan Bosch <stephan@rename-it.nl>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3
MIME-Version: 1.0
To: Sieve mailing list <sieve@ietf.org>
References: <20130210000420.4778.87812.idtracker@ietfa.amsl.com> <5116E5ED.20307@rename-it.nl>
In-Reply-To: <5116E5ED.20307@rename-it.nl>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-RenameIT-MailScanner-SpamScore: -2.3 (--)
X-RenameIT-MailScanner-SpamCheck: No, score=-2.3 required=5.0 tests=ALL_TRUSTED, BAYES_00 autolearn=ham version=3.3.1
Subject: Re: [sieve] Fwd: New Version Notification for draft-bosch-sieve-duplicate-01.txt
X-BeenThere: sieve@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: SIEVE Working Group <sieve.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sieve>, <mailto:sieve-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/sieve>
List-Post: <mailto:sieve@ietf.org>
List-Help: <mailto:sieve-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sieve>, <mailto:sieve-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sat, 09 Mar 2013 11:10:08 -0000

Hi,

On 2/10/2013 1:12 AM, Stephan Bosch wrote:
> Hi,
>
> I made a new version of the "duplicate" draft. It should address the 
> comments by Ned and Alexey.

Any thoughts about this?

Regards,

Stephan.

From alexey.melnikov@isode.com  Sun Mar 10 07:00:51 2013
Return-Path: <alexey.melnikov@isode.com>
X-Original-To: sieve@ietfa.amsl.com
Delivered-To: sieve@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id A359821F863A for <sieve@ietfa.amsl.com>; Sun, 10 Mar 2013 07:00:51 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -101.203
X-Spam-Level: 
X-Spam-Status: No, score=-101.203 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, MIME_QP_LONG_LINE=1.396, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 88ZzAyU-u3Vv for <sieve@ietfa.amsl.com>; Sun, 10 Mar 2013 07:00:51 -0700 (PDT)
Received: from statler.isode.com (statler.isode.com [62.3.217.254]) by ietfa.amsl.com (Postfix) with ESMTP id EDEA021F8639 for <sieve@ietf.org>; Sun, 10 Mar 2013 07:00:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1362924050; d=isode.com; s=selector; i=@isode.com; bh=B8xJ0cV1J6cJTcnbSerA/fDIRamdAAn8oX55Z+OvRac=; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version: In-Reply-To:References:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description; b=CHwQbzzEdVPcAH8xdtwBc43GQ6I6QT7EMaah/tSx8c8vForsMINYCGStLMhJVg3pfrhYKI jZiMxKBChdA5P4RvXmEBZKtq7xL1l1nhia6eg2Mjc2Ko7/x0V2JgfZyv5qB2PJle1bVswb OQu4Uh5oYo9y9m5ahp94oBM+a8x7sv8=;
Received: from [10.0.1.188] ((unknown) [205.204.30.130])  by statler.isode.com (submission channel) via TCP with ESMTPSA  id <UTySEQB51nnY@statler.isode.com>; Sun, 10 Mar 2013 14:00:49 +0000
References: <20130210000420.4778.87812.idtracker@ietfa.amsl.com> <5116E5ED.20307@rename-it.nl> <513B1839.3050202@rename-it.nl>
In-Reply-To: <513B1839.3050202@rename-it.nl>
Message-Id: <4A7CD266-C585-4389-8098-C3D1C25912B5@isode.com>
X-Mailer: iPad Mail (9B206)
From: Alexey Melnikov <alexey.melnikov@isode.com>
Date: Sun, 10 Mar 2013 14:01:20 +0000
To: Stephan Bosch <stephan@rename-it.nl>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Cc: Sieve mailing list <sieve@ietf.org>
Subject: Re: [sieve] Fwd: New Version Notification for draft-bosch-sieve-duplicate-01.txt
X-BeenThere: sieve@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: SIEVE Working Group <sieve.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sieve>, <mailto:sieve-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/sieve>
List-Post: <mailto:sieve@ietf.org>
List-Help: <mailto:sieve-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sieve>, <mailto:sieve-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 10 Mar 2013 14:00:51 -0000

On 9 Mar 2013, at 11:08, Stephan Bosch <stephan@rename-it.nl> wrote:

> Hi,
>=20
> On 2/10/2013 1:12 AM, Stephan Bosch wrote:
>> Hi,
>>=20
>> I made a new version of the "duplicate" draft. It should address the comm=
ents by Ned and Alexey.
>=20
> Any thoughts about this?

Hi Stephan,
This looks much better, thank you.

One new issue is that I don't understand how :value works. Maybe it is a Sun=
day morning effect. Maybe you can show an example or two?


From stephan@rename-it.nl  Tue Mar 12 14:14:39 2013
Return-Path: <stephan@rename-it.nl>
X-Original-To: sieve@ietfa.amsl.com
Delivered-To: sieve@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 322DC21F896E for <sieve@ietfa.amsl.com>; Tue, 12 Mar 2013 14:14:39 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: 0.24
X-Spam-Level: 
X-Spam-Status: No, score=0.24 tagged_above=-999 required=5 tests=[AWL=0.744, BAYES_00=-2.599, HELO_EQ_NL=0.55, HOST_EQ_NL=1.545]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id bh5h4AfGiMeM for <sieve@ietfa.amsl.com>; Tue, 12 Mar 2013 14:14:38 -0700 (PDT)
Received: from drpepper.rename-it.nl (drpepper.rename-it.nl [217.119.238.16]) by ietfa.amsl.com (Postfix) with ESMTP id 7592721F896D for <sieve@ietf.org>; Tue, 12 Mar 2013 14:14:37 -0700 (PDT)
Received: from klara.student.utwente.nl ([130.89.162.218]:50569 helo=[10.168.3.2]) by drpepper.rename-it.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <stephan@rename-it.nl>) id 1UFWWm-0008FG-W5; Tue, 12 Mar 2013 22:14:34 +0100
Message-ID: <513F9A9E.6010008@rename-it.nl>
Date: Tue, 12 Mar 2013 22:14:06 +0100
From: Stephan Bosch <stephan@rename-it.nl>
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3
MIME-Version: 1.0
To: Alexey Melnikov <alexey.melnikov@isode.com>
References: <20130210000420.4778.87812.idtracker@ietfa.amsl.com> <5116E5ED.20307@rename-it.nl> <513B1839.3050202@rename-it.nl> <4A7CD266-C585-4389-8098-C3D1C25912B5@isode.com>
In-Reply-To: <4A7CD266-C585-4389-8098-C3D1C25912B5@isode.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-RenameIT-MailScanner-SpamScore: -2.3 (--)
X-RenameIT-MailScanner-SpamCheck: No, score=-2.3 required=5.0 tests=ALL_TRUSTED, BAYES_00 autolearn=ham version=3.3.1
Cc: Sieve mailing list <sieve@ietf.org>
Subject: Re: [sieve] Fwd: New Version Notification for draft-bosch-sieve-duplicate-01.txt
X-BeenThere: sieve@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: SIEVE Working Group <sieve.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sieve>, <mailto:sieve-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/sieve>
List-Post: <mailto:sieve@ietf.org>
List-Help: <mailto:sieve-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sieve>, <mailto:sieve-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 12 Mar 2013 21:14:39 -0000

Hi Alexey,

On 3/10/2013 3:01 PM, Alexey Melnikov wrote:
> On 9 Mar 2013, at 11:08, Stephan Bosch <stephan@rename-it.nl> wrote:
>
>> I made a new version of the "duplicate" draft. It should address the comments by Ned and Alexey.
>> Any thoughts about this?
> This looks much better, thank you.
>
> One new issue is that I don't understand how :value works. Maybe it is a Sunday morning effect. Maybe you can show an example or two?

To detect duplicates, some more or less unique identifying string value 
must be extracted from the message and compared between deliveries. For 
most cases, the contents of the Message-ID header is the best choice; 
that is what it is meant for. However, to accommodate more complex uses, 
the duplicate test has the flexibility to choose a different string 
value for comparison. Using the :value argument, the string value can be 
set manually to an arbitrary string. Typically, one would compose this 
string using variable substitutions. One can for example compose it from 
parts of a header, the envelope, multiple headers, parts of the message 
body or even the current date; whatever is appropriate for the application.

There is one example of the use of :value in the draft (the second one). 
I should perhaps make the subject header structure a bit more complex to 
justify its use in this example (because :header would work here as well).

Another example would be the following scenario. A mail user receives 
XMPP notifications about new mail through Sieve. Sometimes a single 
contact sends many messages in a short period of time and the user wants 
to prevent being notified of all of those messages. He wants to be 
notified about messages from each person at most once per 30 minutes. He 
writes the following script:

require ["variables", "envelope","enotify", "duplicate"];

if envelope :matches "from" "*" { set "sender" "${1}"; }
if header :matches "subject" "*" { set "subject" "${1}"; }

if not duplicate :seconds 1800 :value "${sender}") {
     notify :message "[SIEVE] ${from}: ${subject}" 
"xmpp:user@im.example.com";
}

So this example uses the message envelope sender rather than the 
Message-ID header as an identifier for duplicate checking.

This example can be extended to allow multiple messages from the same 
sender in close succession as long as the discussed topic is different. 
This could be done as follows:

require ["variables", "envelope","enotify", "duplicate"];

if envelope :matches "from" "*" { set "sender" "${1}"; }
if header :matches "subject" "*" { set "subject" "${1}"; }

if string :comparator "i;ascii-casemap" :matches "${subject}" "Re:*" {
     set "topic" "${1}";
} else {
     set "topic" "${subject}";
}

if not duplicate :seconds 1800 :value "${sender} ${topic}") {
     notify :message "[SIEVE] ${from}: ${topic}" "xmpp:user@im.example.com";
}

Regards,

Stephan.






From NED+mta-filters@mauve.mrochek.com  Fri Mar 15 11:23:42 2013
Return-Path: <NED+mta-filters@mauve.mrochek.com>
X-Original-To: sieve@ietfa.amsl.com
Delivered-To: sieve@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9F3DE21F84E9 for <sieve@ietfa.amsl.com>; Fri, 15 Mar 2013 11:23:42 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level: 
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 8wo4V6VMSFtS for <sieve@ietfa.amsl.com>; Fri, 15 Mar 2013 11:23:41 -0700 (PDT)
Received: from mauve.mrochek.com (mauve.mrochek.com [66.59.230.40]) by ietfa.amsl.com (Postfix) with ESMTP id CFE1321F84DF for <sieve@ietf.org>; Fri, 15 Mar 2013 11:23:41 -0700 (PDT)
Received: from dkim-sign.mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01ORB1SW3CCW001GEA@mauve.mrochek.com> for sieve@ietf.org; Fri, 15 Mar 2013 11:18:40 -0700 (PDT)
MIME-version: 1.0
Content-type: TEXT/PLAIN; CHARSET=iso-8859-1; Format=flowed
Received: from mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01OQTDV5JHPC000054@mauve.mrochek.com> (original mail from NED@mauve.mrochek.com) for sieve@ietf.org; Fri, 15 Mar 2013 11:18:38 -0700 (PDT)
From: NED+mta-filters@mauve.mrochek.com
Message-id: <01ORB1SUSLYS000054@mauve.mrochek.com>
Date: Fri, 15 Mar 2013 10:39:36 -0700 (PDT)
In-reply-to: "Your message dated Sat, 09 Mar 2013 12:08:41 +0100" <513B1839.3050202@rename-it.nl>
References: <20130210000420.4778.87812.idtracker@ietfa.amsl.com> <5116E5ED.20307@rename-it.nl> <513B1839.3050202@rename-it.nl>
To: Stephan Bosch <stephan@rename-it.nl>
Cc: Sieve mailing list <sieve@ietf.org>
Subject: Re: [sieve] Fwd: New Version Notification for	draft-bosch-sieve-duplicate-01.txt
X-BeenThere: sieve@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: SIEVE Working Group <sieve.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sieve>, <mailto:sieve-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/sieve>
List-Post: <mailto:sieve@ietf.org>
List-Help: <mailto:sieve-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sieve>, <mailto:sieve-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 15 Mar 2013 18:23:42 -0000

> Any thoughts about this?

Sorry to take so long to respond; I finally managed to complete my
implementation yesterday.

In implementing this, I saw nothing about the semantics of the test I would
like to see changed. I really like the clever way the single word "duplicate"
ends up doing the right thing in most cases.

The draft also seems pretty complete, although a couple of clarifications
are needed:

(0) A clear execution model is really important here. In particular, the way
    this has to be implemented is that during sieve execution queries
    whatever back end database you're using but does *not* update it.
    Only after the sieve has been evalauted without error and the actions
    it specified have been perform should the database be updated.

    I note that the same applies in environments that support multiple sieves -
    you evaluate them all, apply the results, and for the subset of sieves
    that evaluated without error, perform the updates. I'll also note 
    that how duplicate tests in multiple scripts interact is tricky. I
    eventually decided to qualify duplicate with the sieve "owner", which
    then acts like another handle.

    I don't see any reason to get into the multiple scripts bit in the draft;
    I'm just noting it in case someone is interested.

(1) The draft says nothing about what happens when the specified header
    field does not exist. The test should fail unconditionally in this case.

(2) The draft says nothing about what happens when there are more than one
    of the specified fields present. It should say that the first one
    that is found is used.

(3) The draft probably should say that duplicate does not support either the
    index or mime extensions directly (:index, :mime:, and :anychild), and
    that if you want to perform such checks you can do them with variables
    and :value.

And finally, a few nits:

(1) The "MUST throw a compile time error if both :header and :value are
    specified" is a bit strong. For one thing, such a check is inappropriate
    if ihave is in effect. And for another, while I was able to implement
    it, it may not be convenient for all implementations to perform this
    check at compile time.

(2) I'm wondering if it wouldn't be best to suggest a default timeout.
    12 hours? A day?

(3) A MUST be case-sensitive is probably a good idea, perhaps with a note
    as to how you can use the set action to muck around with case.

That's it! Thanks for producing such a good draft!

				Ned

From kristin.hubner@oracle.com  Fri Mar 15 14:09:59 2013
Return-Path: <kristin.hubner@oracle.com>
X-Original-To: sieve@ietfa.amsl.com
Delivered-To: sieve@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5ECD521F8499 for <sieve@ietfa.amsl.com>; Fri, 15 Mar 2013 14:09:59 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -6.598
X-Spam-Level: 
X-Spam-Status: No, score=-6.598 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, RCVD_IN_DNSWL_MED=-4, UNPARSEABLE_RELAY=0.001]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hztMfVqv42bn for <sieve@ietfa.amsl.com>; Fri, 15 Mar 2013 14:09:58 -0700 (PDT)
Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) by ietfa.amsl.com (Postfix) with ESMTP id A18D321F8494 for <sieve@ietf.org>; Fri, 15 Mar 2013 14:09:58 -0700 (PDT)
Received: from ucsinet22.oracle.com (ucsinet22.oracle.com [156.151.31.94]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id r2FL9upC027643 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 15 Mar 2013 21:09:57 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156]) by ucsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id r2FL9sNn027254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 15 Mar 2013 21:09:56 GMT
Received: from abhmt103.oracle.com (abhmt103.oracle.com [141.146.116.55]) by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id r2FL9sfK023453; Fri, 15 Mar 2013 16:09:54 -0500
Received: from dhcp-amer-vpn-rmdc-anyconnect-10-159-102-202.vpn.oracle.com (/10.159.102.202) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 15 Mar 2013 14:09:53 -0700
Mime-Version: 1.0 (Apple Message framework v1077)
Content-Type: text/plain; charset=us-ascii
From: Kristin Hubner <kristin.hubner@oracle.com>
In-Reply-To: <513F9A9E.6010008@rename-it.nl>
Date: Fri, 15 Mar 2013 14:09:52 -0700
Content-Transfer-Encoding: quoted-printable
Message-Id: <9665C4A7-B59A-459C-8134-798A553B5166@oracle.com>
References: <20130210000420.4778.87812.idtracker@ietfa.amsl.com> <5116E5ED.20307@rename-it.nl> <513B1839.3050202@rename-it.nl> <4A7CD266-C585-4389-8098-C3D1C25912B5@isode.com> <513F9A9E.6010008@rename-it.nl>
To: Stephan Bosch <stephan@rename-it.nl>
X-Mailer: Apple Mail (2.1077)
X-Source-IP: ucsinet22.oracle.com [156.151.31.94]
Cc: Sieve mailing list <sieve@ietf.org>
Subject: Re: [sieve] Fwd: New Version Notification for draft-bosch-sieve-duplicate-01.txt
X-BeenThere: sieve@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: SIEVE Working Group <sieve.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sieve>, <mailto:sieve-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/sieve>
List-Post: <mailto:sieve@ietf.org>
List-Help: <mailto:sieve-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sieve>, <mailto:sieve-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 15 Mar 2013 21:09:59 -0000

A minor comment: I'm not crazy about the ":value" tag name, as I find it
less self-explanatory than I'd prefer.  I'd propose instead ":key", or=20=

or maybe ":uniqueid". =20

Regards,

Kristin

On Mar 12, 2013, at 2:14 PM, Stephan Bosch wrote:

> Hi Alexey,
>=20
> On 3/10/2013 3:01 PM, Alexey Melnikov wrote:
>> On 9 Mar 2013, at 11:08, Stephan Bosch <stephan@rename-it.nl> wrote:
>>=20
>>> I made a new version of the "duplicate" draft. It should address the =
comments by Ned and Alexey.
>>> Any thoughts about this?
>> This looks much better, thank you.
>>=20
>> One new issue is that I don't understand how :value works. Maybe it =
is a Sunday morning effect. Maybe you can show an example or two?
>=20
> To detect duplicates, some more or less unique identifying string =
value must be extracted from the message and compared between =
deliveries. For most cases, the contents of the Message-ID header is the =
best choice; that is what it is meant for. However, to accommodate more =
complex uses, the duplicate test has the flexibility to choose a =
different string value for comparison. Using the :value argument, the =
string value can be set manually to an arbitrary string. Typically, one =
would compose this string using variable substitutions. One can for =
example compose it from parts of a header, the envelope, multiple =
headers, parts of the message body or even the current date; whatever is =
appropriate for the application.
>=20
> There is one example of the use of :value in the draft (the second =
one). I should perhaps make the subject header structure a bit more =
complex to justify its use in this example (because :header would work =
here as well).
>=20
> Another example would be the following scenario. A mail user receives =
XMPP notifications about new mail through Sieve. Sometimes a single =
contact sends many messages in a short period of time and the user wants =
to prevent being notified of all of those messages. He wants to be =
notified about messages from each person at most once per 30 minutes. He =
writes the following script:
>=20
> require ["variables", "envelope","enotify", "duplicate"];
>=20
> if envelope :matches "from" "*" { set "sender" "${1}"; }
> if header :matches "subject" "*" { set "subject" "${1}"; }
>=20
> if not duplicate :seconds 1800 :value "${sender}") {
>    notify :message "[SIEVE] ${from}: ${subject}" =
"xmpp:user@im.example.com";
> }
>=20
> So this example uses the message envelope sender rather than the =
Message-ID header as an identifier for duplicate checking.
>=20
> This example can be extended to allow multiple messages from the same =
sender in close succession as long as the discussed topic is different. =
This could be done as follows:
>=20
> require ["variables", "envelope","enotify", "duplicate"];
>=20
> if envelope :matches "from" "*" { set "sender" "${1}"; }
> if header :matches "subject" "*" { set "subject" "${1}"; }
>=20
> if string :comparator "i;ascii-casemap" :matches "${subject}" "Re:*" {
>    set "topic" "${1}";
> } else {
>    set "topic" "${subject}";
> }
>=20
> if not duplicate :seconds 1800 :value "${sender} ${topic}") {
>    notify :message "[SIEVE] ${from}: ${topic}" =
"xmpp:user@im.example.com";
> }
>=20
> Regards,
>=20
> Stephan.
>=20
>=20
>=20
>=20
>=20
> _______________________________________________
> sieve mailing list
> sieve@ietf.org
> https://www.ietf.org/mailman/listinfo/sieve


From stephan@rename-it.nl  Thu Mar 21 05:06:19 2013
Return-Path: <stephan@rename-it.nl>
X-Original-To: sieve@ietfa.amsl.com
Delivered-To: sieve@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 622D821F8E1C for <sieve@ietfa.amsl.com>; Thu, 21 Mar 2013 05:06:19 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.504
X-Spam-Level: 
X-Spam-Status: No, score=-0.504 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HELO_EQ_NL=0.55, HOST_EQ_NL=1.545]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eYjmWx6bmsnT for <sieve@ietfa.amsl.com>; Thu, 21 Mar 2013 05:06:18 -0700 (PDT)
Received: from drpepper.rename-it.nl (drpepper.rename-it.nl [217.119.238.16]) by ietfa.amsl.com (Postfix) with ESMTP id 8F72621F8E10 for <sieve@ietf.org>; Thu, 21 Mar 2013 05:06:17 -0700 (PDT)
Received: from [217.119.239.130] (port=57490 helo=[192.168.1.109]) by drpepper.rename-it.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <stephan@rename-it.nl>) id 1UIeG0-0007r6-Kn; Thu, 21 Mar 2013 13:06:15 +0100
Message-ID: <514AF7A9.3040502@rename-it.nl>
Date: Thu, 21 Mar 2013 13:06:01 +0100
From: Stephan Bosch <stephan@rename-it.nl>
User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130307 Thunderbird/17.0.4
MIME-Version: 1.0
To: Ned Freed <ned.freed@mrochek.com>
References: <20130210000420.4778.87812.idtracker@ietfa.amsl.com> <5116E5ED.20307@rename-it.nl> <513B1839.3050202@rename-it.nl> <01ORB1SUSLYS000054@mauve.mrochek.com>
In-Reply-To: <01ORB1SUSLYS000054@mauve.mrochek.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-RenameIT-MailScanner-SpamScore: -2.3 (--)
X-RenameIT-MailScanner-SpamCheck: No, score=-2.3 required=5.0 tests=ALL_TRUSTED, BAYES_00 autolearn=ham version=3.3.1
Cc: Sieve mailing list <sieve@ietf.org>
Subject: Re: [sieve] Fwd: New Version Notification for draft-bosch-sieve-duplicate-01.txt
X-BeenThere: sieve@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: SIEVE Working Group <sieve.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sieve>, <mailto:sieve-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/sieve>
List-Post: <mailto:sieve@ietf.org>
List-Help: <mailto:sieve-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sieve>, <mailto:sieve-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Mar 2013 12:06:19 -0000

Hi Ned,

Op 3/15/2013 6:39 PM, Ned Freed wrote:
>> Any thoughts about this?
>
> Sorry to take so long to respond; I finally managed to complete my
> implementation yesterday.
>
> In implementing this, I saw nothing about the semantics of the test I 
> would
> like to see changed. I really like the clever way the single word 
> "duplicate"
> ends up doing the right thing in most cases.
>
> The draft also seems pretty complete, although a couple of clarifications
> are needed:
>
> (0) A clear execution model is really important here. In particular, 
> the way
>    this has to be implemented is that during sieve execution queries
>    whatever back end database you're using but does *not* update it.
>    Only after the sieve has been evalauted without error and the actions
>    it specified have been perform should the database be updated.

Ok, I'll improve that a bit.

>    I note that the same applies in environments that support multiple 
> sieves -
>    you evaluate them all, apply the results, and for the subset of sieves
>    that evaluated without error, perform the updates. I'll also note 
>    that how duplicate tests in multiple scripts interact is tricky. I
>    eventually decided to qualify duplicate with the sieve "owner", which
>    then acts like another handle.
>
>    I don't see any reason to get into the multiple scripts bit in the 
> draft;
>    I'm just noting it in case someone is interested.

Agreed. Perhaps when someone finishes the multiscript draft at some 
point, it could be mentioned there.

> (1) The draft says nothing about what happens when the specified header
>    field does not exist. The test should fail unconditionally in this 
> case.

Agreed.

> (2) The draft says nothing about what happens when there are more than 
> one
>    of the specified fields present. It should say that the first one
>    that is found is used.

Yes, good catch. This is what my current implementation does too.

> (3) The draft probably should say that duplicate does not support 
> either the
>    index or mime extensions directly (:index, :mime:, and :anychild), and
>    that if you want to perform such checks you can do them with variables
>    and :value.

Yes, always good to give hints in the right direction.

> And finally, a few nits:
>
> (1) The "MUST throw a compile time error if both :header and :value are
>    specified" is a bit strong. For one thing, such a check is 
> inappropriate
>    if ihave is in effect. And for another, while I was able to implement
>    it, it may not be convenient for all implementations to perform this
>    check at compile time.

I'm not sure what you mean here. Do you want me to make the kind of 
error more open, e.g. by adopting the wording used for the :zone and 
:originalzone arguments for the date extension?

`It is an error to specify both :zone and :originalzone.'

Which basically leaves the kind of error up to the implementer. I have no problem with that.

> (2) I'm wondering if it wouldn't be best to suggest a default timeout.
>    12 hours? A day?

It can be useful. Anyone else got suggestions or comments about this?

> (3) A MUST be case-sensitive is probably a good idea, perhaps with a note
>    as to how you can use the set action to muck around with case.

Yes, otherwise users could get surprised at some point.

> That's it! Thanks for producing such a good draft!

Thanks. I'll make a new version some time next week.

Regards,

Stephan.


From stephan@rename-it.nl  Thu Mar 21 05:11:46 2013
Return-Path: <stephan@rename-it.nl>
X-Original-To: sieve@ietfa.amsl.com
Delivered-To: sieve@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C558521F8DB9 for <sieve@ietfa.amsl.com>; Thu, 21 Mar 2013 05:11:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.504
X-Spam-Level: 
X-Spam-Status: No, score=-0.504 tagged_above=-999 required=5 tests=[BAYES_00=-2.599, HELO_EQ_NL=0.55, HOST_EQ_NL=1.545]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tWlbktm3sK0Q for <sieve@ietfa.amsl.com>; Thu, 21 Mar 2013 05:11:44 -0700 (PDT)
Received: from drpepper.rename-it.nl (drpepper.rename-it.nl [217.119.238.16]) by ietfa.amsl.com (Postfix) with ESMTP id A27B121F874B for <sieve@ietf.org>; Thu, 21 Mar 2013 05:11:44 -0700 (PDT)
Received: from wlan028045.mobiel.utwente.nl ([130.89.28.45]:57649) by drpepper.rename-it.nl with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from <stephan@rename-it.nl>) id 1UIeLG-0007xL-Nf; Thu, 21 Mar 2013 13:11:41 +0100
Message-ID: <514AF8ED.9060308@rename-it.nl>
Date: Thu, 21 Mar 2013 13:11:25 +0100
From: Stephan Bosch <stephan@rename-it.nl>
User-Agent: Mozilla/5.0 (Windows NT 6.0; rv:17.0) Gecko/20130307 Thunderbird/17.0.4
MIME-Version: 1.0
To: Kristin Hubner <kristin.hubner@oracle.com>
References: <20130210000420.4778.87812.idtracker@ietfa.amsl.com> <5116E5ED.20307@rename-it.nl> <513B1839.3050202@rename-it.nl> <4A7CD266-C585-4389-8098-C3D1C25912B5@isode.com> <513F9A9E.6010008@rename-it.nl> <9665C4A7-B59A-459C-8134-798A553B5166@oracle.com>
In-Reply-To: <9665C4A7-B59A-459C-8134-798A553B5166@oracle.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-RenameIT-MailScanner-SpamScore: -2.3 (--)
X-RenameIT-MailScanner-SpamCheck: No, score=-2.3 required=5.0 tests=ALL_TRUSTED, BAYES_00 autolearn=ham version=3.3.1
Cc: Sieve mailing list <sieve@ietf.org>
Subject: Re: [sieve] Fwd: New Version Notification for draft-bosch-sieve-duplicate-01.txt
X-BeenThere: sieve@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: SIEVE Working Group <sieve.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sieve>, <mailto:sieve-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/sieve>
List-Post: <mailto:sieve@ietf.org>
List-Help: <mailto:sieve-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sieve>, <mailto:sieve-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Mar 2013 12:11:46 -0000

Op 3/15/2013 10:09 PM, Kristin Hubner schreef:
> A minor comment: I'm not crazy about the ":value" tag name, as I find it
> less self-explanatory than I'd prefer.  I'd propose instead ":key", or
> or maybe ":uniqueid".

Ok, I understand, but I don't really have a preference; either ":key" or 
":uniqueid" makes sense. Anyone else got suggestions or strong opinions 
about this? :)

Regards,

Stephan.


From NED+mta-filters@mauve.mrochek.com  Thu Mar 21 07:44:52 2013
Return-Path: <NED+mta-filters@mauve.mrochek.com>
X-Original-To: sieve@ietfa.amsl.com
Delivered-To: sieve@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 93D4A21F9096 for <sieve@ietfa.amsl.com>; Thu, 21 Mar 2013 07:44:52 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level: 
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-2.599]
Received: from mail.ietf.org ([12.22.58.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QJR3a1D0kqmB for <sieve@ietfa.amsl.com>; Thu, 21 Mar 2013 07:44:52 -0700 (PDT)
Received: from mauve.mrochek.com (mauve.mrochek.com [66.59.230.40]) by ietfa.amsl.com (Postfix) with ESMTP id 126F021F9063 for <sieve@ietf.org>; Thu, 21 Mar 2013 07:44:52 -0700 (PDT)
Received: from dkim-sign.mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01ORJ7WK87UO001C02@mauve.mrochek.com> for sieve@ietf.org; Thu, 21 Mar 2013 07:39:46 -0700 (PDT)
MIME-version: 1.0
Content-type: TEXT/PLAIN; CHARSET=iso-8859-1; format=flowed
Received: from mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01ORC9WZBCPS000054@mauve.mrochek.com> (original mail from NED@mauve.mrochek.com) for sieve@ietf.org; Thu, 21 Mar 2013 07:39:42 -0700 (PDT)
From: NED+mta-filters@mauve.mrochek.com
Message-id: <01ORJ7WHQGAE000054@mauve.mrochek.com>
Date: Thu, 21 Mar 2013 07:37:29 -0700 (PDT)
In-reply-to: "Your message dated Thu, 21 Mar 2013 13:06:01 +0100" <514AF7A9.3040502@rename-it.nl>
References: <20130210000420.4778.87812.idtracker@ietfa.amsl.com> <5116E5ED.20307@rename-it.nl> <513B1839.3050202@rename-it.nl> <01ORB1SUSLYS000054@mauve.mrochek.com> <514AF7A9.3040502@rename-it.nl>
To: Stephan Bosch <stephan@rename-it.nl>
Cc: Sieve mailing list <sieve@ietf.org>, Ned Freed <ned.freed@mrochek.com>
Subject: Re: [sieve] Fwd: New Version Notification for draft-bosch-sieve-duplicate-01.txt
X-BeenThere: sieve@ietf.org
X-Mailman-Version: 2.1.12
Precedence: list
List-Id: SIEVE Working Group <sieve.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/sieve>, <mailto:sieve-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/sieve>
List-Post: <mailto:sieve@ietf.org>
List-Help: <mailto:sieve-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/sieve>, <mailto:sieve-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 21 Mar 2013 14:44:52 -0000

> > And finally, a few nits:
> >
> > (1) The "MUST throw a compile time error if both :header and :value are
> >    specified" is a bit strong. For one thing, such a check is
> > inappropriate
> >    if ihave is in effect. And for another, while I was able to implement
> >    it, it may not be convenient for all implementations to perform this
> >    check at compile time.

> I'm not sure what you mean here. Do you want me to make the kind of
> error more open, e.g. by adopting the wording used for the :zone and
> :originalzone arguments for the date extension?

> `It is an error to specify both :zone and :originalzone.'

> Which basically leaves the kind of error up to the implementer. I have no problem with that.

I was unclear, sorry. I was talking about having to catch the error at compile
time. I think catching it at execution time should be allowed.

> > (2) I'm wondering if it wouldn't be best to suggest a default timeout.
> >    12 hours? A day?

> It can be useful. Anyone else got suggestions or comments about this?

Yeah, this is one where additional comments would really be nice.

> > (3) A MUST be case-sensitive is probably a good idea, perhaps with a note
> >    as to how you can use the set action to muck around with case.

> Yes, otherwise users could get surprised at some point.

> > That's it! Thanks for producing such a good draft!

> Thanks. I'll make a new version some time next week.

Excellent.

				Ned
