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

Re: Action interaction - specifically discard+keep and discard+reject

2001-02-13 19:07:24
Hi folks.  I see Janurary has passed without the annual Action interaction
debate :o).  I'm not suggesting we restart it, but after spending 3 hours
reading the old postings I'm getting very confused and was wondering if 
someone
could clear this lot up for me...


Suppose this is my script:
  if A { keep; }
  if B { discard; }

It is obvious what I've to do if either A or B is true, and if neither A nor
B is true, but what do I do when A AND B are true?

If A and B are both true you need to get an evaluation error. This should be
explicit in the document but apparently isn't; however, the document does say
that such absurd situations exist and need to be handled this way.

I think that I am meant to interpret it this way:  When I start processing
the script, the action on my list is "Implicit Keep".  When I am told to 
"keep"
then I cancel the "Implicit Keep", and replace it with an explicit "keep". 

Yes.

When I am told to "discard" the message, I would normally cancel the "Implicit
Keep" but as I have already canceled the "Implicit Keep", the "discard" has no
effect here.

Nope. It's an error and you need to treat it as such.

Were the script to be the other way round, ie:
  discard;
  keep;

Then when I read the "discard" I cancel the "Implicit Keep", leaving me with
no actions on my list, and when I read the "keep", I place an explicit "keep"
on the list.

Nope. This is also an error.

Or am I meant to be producing a compile time/run time error?

Yes, that's what you should do.

So in terms of what we can conveniently tell the user in a rule based GUI a
discard says "Discard the message unless explicitly told to keep it by another
rule" and if they don't want other rules to mess them about then they have to
follow it with a "stop", and ensure that no previous rule explicitly asked to
keep this message.  But the discard action isn't really a hard and fast "chuck
away this message" unless followed by a stop, and not preceeded by any keep
commands?

Well, sort of. Once you hit a discard the script either discards the message
or terminates abnormally. 

--------------------------------------------------------------------------------

Sticking to this precise definition of a "discard" to be cancelling the
implicit keep, am I right in saying that:

discard+reject = reject;

No, this is again an error, since you cannot honor the requirements of discard
and reject simultaneously.

reject+(keep or redirect or fileinto or reject) = error;

Yes, although this is actually a less stringent requirement than the
combination of discard and reject.

as reject presumably cancels the implicit keep too so the addition of discard
and reject isn't really an error as it just ends up with a reject.

No, it is an error.

--------------------------------------------------------------------------------

2.10.2
   An implicit keep is performed if a message is not written to a
   mailbox, redirected to a new address, or explicitly thrown out.  That
   is, if a fileinto, a keep, a redirect, or a discard is performed, an
   implicit keep is not.

Presumably this list should include reject, or are we happy enough that it is
implied in the "Implementations SHOULD prohibit reject when used with other
actions" statement of section 2.10.4

I believe reject should be on this list.

                                Ned