Subject: [sieve] proposal: align header with address

From: Arnt Gulbrandsen <[email-masked]>
Date: Wed, 24 Mar 2010 10:12:16 +0100

Hi,

an introduction first, as rationale.

Several years ago I proofread parts of book which, among other things, 
explained how to write sieve scripts. The authors used the header test 
throughout. Prose like this:

   To test whether an address is addressed to [email-masked], you write

     if header "to" :is "[email-masked]" {
         fileinto "roles/fred";
     }

I explained that 'if address' was the right test. They didn't believe 
that header was wrong, and showed me examples proving its correctness, 
eventually switching to from :is to :contains (mishandling alfred@).

Not sure what the printed book said.

People do misuse header in that way quite often. I've corrected the 
error in internet-drafts several times, and recently (a few months ago) 
I saw a misused 'if header' in a published RFC.

When even the sieve WG members misuse a test, it's time to adapt the 
test to human reality.

So here's my proposal:

1. In the next iteration of base Sieve RFC, either allow or recommend 
testing address fields as though 'if address' were specified, even if 
'if header' is specified.

2. Publish this an erratum now.

Arnt

---

From: Aaron Stone <[email-masked]>
Date: Wed, 24 Mar 2010 08:21:56 -0700

On Wed, Mar 24, 2010 at 2:12 AM, Arnt Gulbrandsen
<[email-masked]> wrote:
> I explained that 'if address' was the right test. They didn't believe that
> header was wrong, and showed me examples proving its correctness, eventually
> switching to from :is to :contains (mishandling alfred@).
>
> People do misuse header in that way quite often. I've corrected the error in
> internet-drafts several times, and recently (a few months ago) I saw a
> misused 'if header' in a published RFC.
>
> When even the sieve WG members misuse a test, it's time to adapt the test to
> human reality.
>
> So here's my proposal:
>
> testing address fields as though 'if address' were specified, even if 'if
> header' is specified.

Based on a the heuristic of seeing an @ sign?

> 2. Publish this an erratum now.

[Simplistic question to elicit details:]
When and how do 'if address' and 'if header :contains' differ?

Perhaps this table is what we publish as the erratum, explaining that
yes, it will sometimes work, but here's how it's going to break.

Cheers,
Aaron

---

From: Arnt Gulbrandsen <[email-masked]>
Date: Wed, 24 Mar 2010 16:42:30 +0100

> Based on a the heuristic of seeing an @ sign?

No. For a specified list of address fields. To, From, Cc will do, IMO.

> When and how do 'if address' and 'if header :contains' differ?

When one address (or domain) is a substring of another. [email-masked] 
vs. [email-masked], [email-masked] vs. [email-masked], foo.com vs 
burblefoo.com. Subaddresses may be another case, I don't remember.

'if address :is' also breaks when several addresses are used (To: 
aaron@x, foo@y) and so on.

> yes, it will sometimes work, but here's how it's going to break.

I don't really care. I don't make this mistake. I'd like the people 
who've published drafts or even RFCs with this mistake to decide on the 
proper approach, they know it better than I do.

Arnt

---

From: [email-masked]
Date: Wed, 24 Mar 2010 14:58:32 -0700 (PDT)

> Based on a the heuristic of seeing an @ sign?

I have to say I think this is a *really* bad idea. While I am sympathetic to
the issue here, there are plenty of cases where I want to test an address field
using header and not address. Obvious one: Syntactically invalid fields that
address cannot parse.

> > 2. Publish this an erratum now.

Even stronger objection. THis is in no way, shape, or form an error in the
specificaiton, and it is a serious abuse of the errata process to make a
fundamental change to Sieve semantics.

> yes, it will sometimes work, but here's how it's going to break.

A discussion of thise issues strikes me as an excellent thing to put in a
"uses of Sieve " document. That's the way to attack this issue, not by
mucking up the clean semantics we currently have.

				Ned

---

From: Aaron Stone <[email-masked]>
Date: Wed, 24 Mar 2010 15:16:02 -0700

> mucking up the clean semantics we currently have.

I personally don't like Arnt's proposal of making header behave as address.

I do like the idea of posting a clarification that yes, they are
different, and really, we mean it, as an erratum if that's a
reasonable use of errata.

Aaron

---

From: Arnt Gulbrandsen <[email-masked]>
Date: Thu, 25 Mar 2010 08:15:47 +0100

On 03/24/2010 10:58 PM, Ned Freed wrote:
> "uses of Sieve " document.

Fine.

> That's the way to attack this issue, not by

*mumble*

Arnt