Subject: Question concerning subaddress extension

From: Michael Haardt <[email-masked]>
Date: Fri, 11 Mar 2005 16:48:16 +0100

Hello,

I am just trying to implement the subaddress extension in Exim.
What should the subaddress extension do for this example?

   if envelope :detail "from" "foo" {
     redirect "[email-masked]";
   }

The semantics are well defined for envelope "to".  But envelope
"from"? Obviously, Sieve can not know the separator used by the sender,
if any at all. Yet the above is not forbidden.

The original example from RFC 3598 uses envelope "cc" and envelope "bcc".
The current draft fixed that, but it brought up an interesting issue:
What should happen when using it? RFC 3028 specifies "from" and "to",
but does not say a word about using keys not known by the implementation.
While wondering about this, I read:

   If a protocol other than SMTP is used for message transport,
   implementations are expected to adapt this command appropriately.

Does that mean new keys, or does that mean to adapt the meaning of
the existing keys?

Michael

---

From: [email-masked]
Date: Sat, 12 Mar 2005 15:37:26 -0800 (PST)

> if any at all. Yet the above is not forbidden.

IMO the interpreter should do the best it can: Apply the separator
rules it knows.

The alternative of disallowing the test is not particularly palatable.

Another alternative is to require implementations to only extract
subaddresses for domains with known semantics. But that tehn requires
implementations to know when the semantics apply, which may be
an even more difficult problem.

Given that the primary use of subaddress is in conjunction with
envelope "to" (or possibly header "to" or "cc"), it is hard to get
excited about this either way.

				Ned

---

From: Cyrus Daboo <[email-masked]>
Date: Sat, 12 Mar 2005 19:16:03 -0500

Hi [email-masked],

> excited about this either way.

Another option might be to allow the separator to be specified as a 
parameter in the test, as its likely that the script author may have more 
explicit knowledge of the separator in addresses being tested. e.g. I know 
that the separator for my domain is '+' and for 'example.com' is ';'

    if envelope :separator "+" :user "daboo" :domain "isamet.com" {
      redirect "[email-masked];
    }
    if envelope :separator ";" :user "daboo" :domain "example.com" {
      redirect "[email-masked];
    }

-- 
Cyrus Daboo

---

From: Cyrus Daboo <[email-masked]>
Date: Sat, 12 Mar 2005 19:41:43 -0500

Hi,

--On Saturday, March 12, 2005 07:16:03 PM -0500 Cyrus Daboo 
<[email-masked]> wrote:

> explicit knowledge of the separator in addresses being tested. e.g. I
> know that the separator for my domain is '+' and for 'example.com' is ';'
>

Actually I've changed my mind - subaddress should do a best effort on the 
separator, and for more explicit control regex can be used.

-- 
Cyrus Daboo

---

From: [email-masked]
Date: Sun, 13 Mar 2005 10:22:15 -0800 (PST)

> separator, and for more explicit control regex can be used.

Or :matches, for that matter.

I think the key issue here is the intent underlying the subaddress extension.
If the only intent is to slightly simplify something like:

    if envelope :is "to" "[email-masked]" ...

or even

    if envelope :matches "to" "*+foo@*" ....

we haven't accomplished much. But the real purpose of the subaddress extension
is to avoid having to explicitly code separator rules in the sieve script.
Portability, in other words. If we then change the subaddress extension
so you can specify the separator, we've in effect undone the primary
reason for having the extension.

				Ned

---

From: Kjetil Torgrim Homme <[email-masked]>
Date: Sun, 13 Mar 2005 20:39:33 +0100

On Sun, 2005-03-13 at 10:22 -0800, [email-masked] wrote:
> Cyrus Daboo wrote:
> Or :matches, for that matter. [...] But the real purpose of the subaddress extension

agreed.  however, I think "best effort" is dangerous wording.  it is
better to specifically state that the same subaddress syntax as
envelope-to will be assumed for envelope-from.  who knows what strange
surprises we get if the implementation thinks hyphen is a nice separator
for some domains.
-- 
Kjetil T.

---

From: [email-masked]
Date: Sun, 13 Mar 2005 14:40:14 -0800 (PST)

> surprises we get if the implementation thinks hyphen is a nice separator

An explicit statement is definitely the way to go.

				Ned

P.S. Due the fact that so many web forms and such block the use of the
more common subaddress separator characters "+" and "=", I've actually
seen "-" used as a separator.