Re: Re: Quoted pairs in the test suite

"Stuart D. Gathman" <[email protected]> Mon, 14 Apr 2008 15:26:53 -0400 (EDT)
Newsgroups gmane.mail.spam.spf.devel
Message-ID <[email protected]>
On Mon, 14 Apr 2008, Julian Mehnle wrote:

> > You could argue that %{l}@%{d} (in an exp, for example) should be a
> > syntactically valid email.  And leaving the quotes intact would be the
> > easiest way to ensure that.
> 
> You cannot expect SPF implementations to safely generate valid RFC 2821/ 
> 2822 local-parts.  You could say "%{l}"@%{d} (with the quotes) in an 
> explanation string, but if the local-part's _value_ was "foo (with the 
> quote), the SPF implementation would generate ""foo"@<domain>, whereas 
> the proper RFC 2821/2822 representation would be "\"foo"@<domain>.
> 
> It cannot be done reliably.  SPF wasn't designed to do it.

You missed the point.  If %{l} simply echoes the localpart with quoting
intact, then if the original email was <"\"foo"@example.com>, %{l}
would expand to "\"foo" (with the quotes), rather than try to undo the
quoting.  If mail from was <"foo"@example.com> (with the redundant quotes),
then %{l} per my suggestion would be "foo".  A similar question goes
for %{s}, which can leave quoting alone, or try to remove it.

I'm saying that removing the quotes is a lot of trouble, and leaving them
alone leave %{s} as a valid email (if mail from was to begin with).

-- 
	      Stuart D. Gathman <[email protected]>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.