Subject: Envelope tests on null or illegal MAIL FROM (non)addresses

From: Ned Freed <[email-masked]>
Date: Wed, 14 Jun 2006 08:03:55 -0700 (PDT)

I think the base specification could use a little clarification about
how this is supposed to be handled.

The main issue is that the envelope test deals with data in a structured way:
THe :domain and :localpart tests operate on parts of an address and hence
require parsing, and even :all is required to discard source route information,
which also requires parsing.

People definitely want to be able to write things like:

    if envelope :is :all "from" "" {empty envelope from, handle as report}

But what should

    envelope :is: :domain "from" ""

do? And if the MAIL FROM address is syntactically invalid, what should happen?

FWIW, I'd be in favor of having a null MAIL FORM result in an empty string
being tested regardless of which ADDRESS-PART is specified. As for invalid
MAIL FROM values, I'm inclined to say that :all should test against the
literal string inside the <>s and :domain and :localpart should test
against the empty string. This way you can test for specific bogons and
handle them accordingly.

THoughts?

				Ned

---

From: Kjetil Torgrim Homme <[email-masked]>
Date: Wed, 14 Jun 2006 23:37:00 +0200

On Wed, 2006-06-14 at 08:03 -0700, Ned Freed wrote:
> being tested regardless of which ADDRESS-PART is specified.

agreed.

>  As for invalid

as a user, I would expect it to do the simple thing, and split on the
(rightmost) @.  but by requiring syntax correctness, we protect users
from themselves, ie. if they write a match expression which didn't
consider the possibility of some particular external garbage.

wouldn't it be better to say that :localpart and :domain never match
when the address is a bogon, though?  I don't see what we gain by making
it "alias" into an empty sender, even if the recommended and natural way
of checking for the empty sender is with :all.
-- 
Kjetil T.

---

From: Ned Freed <[email-masked]>
Date: Wed, 14 Jun 2006 14:40:25 -0700 (PDT)

> of checking for the empty sender is with :all.

Good point. I agree that domain and localpart matches should never match when
dealing with an unparseable address.

				Ned

---

From: "Mark E. Mallett" <[email-masked]>
Date: Wed, 14 Jun 2006 18:09:56 -0400

On Wed, Jun 14, 2006 at 11:37:00PM +0200, Kjetil Torgrim Homme wrote:
> when the address is a bogon, though?

Whether it is correct or not, this is what I happen to do: if the
address parse fails, the match fails.  Although admittedly it's really
hard to make the parse fail in that particular place (tightening it up
is on the seemingly-ever-growing TODO list).

mm