ietf-mta-filters
[Top] [All Lists]

Re: [sieve] proposal: align header with address

2010-03-24 10:22:58
On Wed, Mar 24, 2010 at 2:12 AM, Arnt Gulbrandsen
<arnt(_at_)gulbrandsen(_dot_)priv(_dot_)no> wrote:
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 fred(_at_)example(_dot_)org, you 
write

   if header "to" :is "fred(_at_)example(_dot_)org" {
       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.

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
_______________________________________________
sieve mailing list
sieve(_at_)ietf(_dot_)org
https://www.ietf.org/mailman/listinfo/sieve