spf-discuss
[Top] [All Lists]

Re: SPF Validation Tools - Yet Another One

2005-07-07 13:27:16
In <20050707195603(_dot_)GA25415(_at_)alatheia(_dot_)elm(_dot_)net> Alex van 
den Bogaerdt <alex(_at_)ergens(_dot_)op(_dot_)het(_dot_)net> writes:

On Thu, Jul 07, 2005 at 10:29:48AM -0500, wayne wrote:

" evaluating v=spf1 a mx ptr *all ...
  Results - SPF Permanent Error: Unknown mechanism found: *all
"

should read "unknown qualifier found: *".  This seems to be an
omission in the current specification by the way.

The current ABFN says:

   directive        = [ qualifier ] mechanism
   qualifier        = "+" / "-" / "?" / "~"
   mechanism        = ( all / include
                      / A / MX / PTR / IP4 / IP6 / exists )

So, we try to separate directive "*all" in: [ qualifier ] mechanism

Now match known mechanism "all" and prepend unknown qualifier "*".
This is no less valid than your explanation and IMHO more valid.

If you parse "*all" as the directive, you end up with one of these:

"" "*all"   where qualifier is empty and mechanism is error
"*" "all"   where qualifier is error and mechanism is known

Best match would be one invalid character "*" and three valid
chars "all".  Your way of thinking results in four invalid chars

Ah, ok, I think I understand your point now.  In either case, the ABNF
in the spec requires this to be a syntax error, the question is "what
kind of syntax error?".

This is the bane of most compilers.  What is the correct error message
for "al"?  or "?al"?  or "*al"?  or "?-all"?

One minor point.  You refer to "your way of thinking" and such, but
I'm not Scott and I didn't write Scott's validation tool.  If you just
mixed up who ways saying what, no problems.  If, instead, I'm confused
or you are trying to make a different point that I've missed, please
let me know.


As far as what I actually think, the following are the results that
libspf2 gives:


(wayne(_at_)footbone) $ spftest spf "v=spf1 *all"
Invalid mechanism prefix near "" in "*all"

(wayne(_at_)footbone) $ spftest spf "v=spf1 al"
Unknown mechanism found in "al".

(wayne(_at_)footbone) $ spftest spf "v=spf1 ?al"
Unknown mechanism found near "al" in "?al"

(wayne(_at_)footbone) $ spftest spf "v=spf1 *al"
Invalid mechanism prefix near "" in "*al"

(wayne(_at_)footbone) $ spftest spf "v=spf1 ?-all"
Invalid mechanism prefix near "?" in "?-all"


I'm not sure that I really like the results libspf2 is giving, but the
do seem to more closely match your idea of detecting the qualifier as
being invalid, rather than detecting the whole token as being the
mechanism. 


If you can't see it my way, perhaps say:
  Results - SPF Permanent Error: Unknown directive found: *all

I would say "invalid driective found", rather than "unknown", but
yeah, this is a good way of dodging the whole problem.


-wayne