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

Re: Is envelope missing :comparator arguement?

1999-02-22 13:52:37
Date: Mon, 22 Feb 1999 14:29:55 -0500
From: Gregory Sereda <gsereda(_at_)maillennium(_dot_)att(_dot_)com>

It appears to me that the ADDRESS-PART arugment, in conjunction with
the COMPARATOR argument, allows a script to do the "right thing".
If so, the "envelope" should include the COMPARATOR arugment.

I think this is what was intended.  I have added a COMPARATOR argument
to the envelope test.

Given your argument, which I'm going to attempt to discuss below, there
are three things that we can do:

        (1) nothing
        (2) add COMPARATOR to envelope
        (3) make envelope and address responsible for more address
            parsing

(1) is dumb.  (2) is easy, so I've done (2).  We can revise the draft to
(3) later if we want.  I'm going to put out a draft real soon now and
(2) is an improvement, if nothing else.


As an aside, a sieve that wants to do the "right thing" when checking
for an e-mail address would look like the following....

 # localpart of address is case-sensitive, domain is not.
 if allof ( address :is :localpart :comparator "i;octet" "from" "tim",
    address :is :domain "from" "example.com" ) {
    discard;
 }

      To: TIM(_at_)example(_dot_)com
      To: tim(_at_)cia(_dot_)gov

Neither one of these user's address match "tim(_at_)example(_dot_)com", but 
the
script thinks so.

That script, in particular, is easily fixed:

 if allof ( address :matches :all :comparator "i;octet" "from" "tim(_at_)*",
    address :matches :all "from" "*(_at_)example(_dot_)com" ) {
    discard;

I am not sure if this solution generalizes, but I think "match" lets it
do so rather reasonably.

The problem is the that the ADDRESS-PART cannot be
related to another "address" test so both the :localpart and :domain
parts are operating on the same address.

It seems to me that this can be fixed by having the "envelope" and
"address" tests deal (correctly) with the case of the localpart and
domain part.

That is very difficult to nail down.  Consider this test:

if address :contains "from" "andrew" { ...

Does "andrew" refer to the local-part or the domain-part?

What about the large number of MTAs where local-parts are
case-insensitive? On rare occasions, I get mail to 
TJS+(_at_)ANDREW(_dot_)CMU(_dot_)EDU,
and filtering on that is a reasonable thing to do.

What about UTF-8 in mail addresses, which is going to happen?

If we're going to go this route, we should just require that the domain-part
be canonicalized to lower (or upper) case, then STILL allow COMPARATOR
to cover case-insensitive local-parts.

-- 
Tim Showalter <tjs+(_at_)andrew(_dot_)cmu(_dot_)edu>