Problem with RFC 4408
jannisohms@aol.com Wed, 15 July 2015 17:54 UTC
Return-Path: <jannisohms@aol.com>
X-Original-To: ietf@ietfa.amsl.com
Delivered-To: ietf@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 5F8151B3302 for <ietf@ietfa.amsl.com>; Wed, 15 Jul 2015 10:54:35 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.89
X-Spam-Level:
X-Spam-Status: No, score=-1.89 tagged_above=-999 required=5 tests=[BAYES_50=0.8, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, GB_I_LETTER=-2, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_FILL_THIS_FORM_FRAUD_PHISH=0.01, T_FILL_THIS_FORM_SHORT=0.01, T_RP_MATCHES_RCVD=-0.01] autolearn=ham
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3cX7_uvXzaTu for <ietf@ietfa.amsl.com>; Wed, 15 Jul 2015 10:54:34 -0700 (PDT)
Received: from omr-m08.mx.aol.com (omr-m08.mx.aol.com [64.12.222.129]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D79001B32F8 for <ietf@ietf.org>; Wed, 15 Jul 2015 10:54:33 -0700 (PDT)
Received: from mtaomg-mcd01.mx.aol.com (mtaomg-mcd01.mx.aol.com [172.26.223.207]) by omr-m08.mx.aol.com (Outbound Mail Relay) with ESMTP id DE5E770511D03 for <ietf@ietf.org>; Wed, 15 Jul 2015 13:54:32 -0400 (EDT)
Received: from core-mqb05d.mail.aol.com (core-mqb05.mail.aol.com [172.27.61.15]) by mtaomg-mcd01.mx.aol.com (OMAG/Core Interface) with ESMTP id 8F7AE38000086 for <ietf@ietf.org>; Wed, 15 Jul 2015 13:54:32 -0400 (EDT)
Received: from 62.227.229.72 by webprd-m03.mail.aol.com (10.74.16.251) with HTTP (WebMailUI); Wed, 15 Jul 2015 13:54:32 -0400
Date: Wed, 15 Jul 2015 13:54:32 -0400
From: jannisohms@aol.com
To: ietf@ietf.org
Message-Id: <14e92da898f-5bf-115db@webprd-m03.mail.aol.com>
Subject: Problem with RFC 4408
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
X-MB-Message-Source: WebUI
X-MB-Message-Type: User
X-Mailer: JAS STD
X-Originating-IP: [62.227.229.72]
x-aol-global-disposition: G
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mx.aol.com; s=20150623; t=1436982872; bh=Z3HHov+tEFd0QppITPFczBa7FnBY4MIOSVPGRnQMEUk=; h=From:To:Subject:Message-Id:Date:MIME-Version:Content-Type; b=CuAvWRMjDR5C9jHRspfzdrxxNEpSfsFvFL4PzkEfNhKPnTYWaZjQIC09E6/16rvB3 HDQPh+j/ACG1eCPaiXKMSYRbFnFOOQRXvWBmAUO4Kl3984K9c2cPrn82zSV4JO4OI4 ybyDKASetrdWnm74Z0V5UHxMzc/S7f0sdeDFk30Y=
x-aol-sid: 3039ac1adfcf55a69e5804fb
Archived-At: <http://mailarchive.ietf.org/arch/msg/ietf/j5dz3No8MF6Tj_pBoDTVqhrnz78>
X-BeenThere: ietf@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: IETF-Discussion <ietf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf>, <mailto:ietf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ietf/>
List-Post: <mailto:ietf@ietf.org>
List-Help: <mailto:ietf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf>, <mailto:ietf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 15 Jul 2015 17:56:59 -0000
Iam currently trying to implement a parser for spf . to achive this I took the grammar defined in RFC 4408 and added some parts of RFC 2234 and RFC2822. I use aparse 2.5 to build my parser. I used the following grammar. record = version terms *SP ; version = "v=spf1" ; terms = *( 1*SP ( directive / modifier ) ) ; directive = [ qualifier ] mechanism ; qualifier = "+" / "-" / "?" / "~" ; mechanism = ( all / include / A / MX / PTR / IP4 / IP6 / exists ) ; all = "all" ; include = "include" ":" domain-spec ; A = "a" [ ":" domain-spec ] [ dual-cidr-length ] ; MX = "mx" [ ":" domain-spec ] [ dual-cidr-length ] ; PTR = "ptr" [ ":" domain-spec ] ; IP4 = "ip4" ":" ip4-network [ ip4-cidr-length ] ; IP6 = "ip6" ":" ip6-network [ ip6-cidr-length ] ; exists = "exists" ":" domain-spec ; modifier = redirect / explanation / unknown-modifier ; redirect = "redirect" "=" domain-spec ; explanation = "exp" "=" domain-spec ; unknown-modifier = name "=" macro-string ; ip4-cidr-length = "/" 1*DIGIT ; ip6-cidr-length = "/" 1*DIGIT ; dual-cidr-length = [ ip4-cidr-length ] [ "/" ip6-cidr-length ] ; ip4-network = qnum "." qnum "." qnum "." qnum ; qnum = DIGIT / %x31-39 DIGIT / "1" 2DIGIT / "2" %x30-34 DIGIT / "25" %x30-35 ; ip6-network = "<as per [RFC 3513], section 2.2>" ; domain-spec = macro-string domain-end ; domain-end = ( "." toplabel [ "." ] ) / macro-expand ; toplabel = ( *alphanum ALPHA *alphanum ) / ( 1*alphanum "-" *( alphanum / "-" ) alphanum ) ; alphanum = ALPHA / DIGIT ; explain-string = *( macro-string / SP ) ; macro-string = *( macro-expand / macro-literal ) ; macro-expand = ( "%{" macro-letter transformers *delimiter "}" ) / "%%" / "%_" / "%-" ; macro-literal = %x21-24 / %x26-7E ; macro-letter = "s" / "l" / "o" / "d" / "i" / "p" / "h" / "c" / "r" / "t" ; transformers = *DIGIT [ "r" ] ; delimiter = "." / "-" / "+" / "," / "/" / "_" / "=" ; name = ALPHA *( ALPHA / DIGIT / "-" / "_" / "." ) ; header-field = "Received-SPF:" [CFWS] result FWS [comment FWS] [ key-value-list ] CRLF ; result = "Pass" / "Fail" / "SoftFail" / "Neutral" / "None" / "TempError" / "PermError" ; key-value-list = key-value-pair *( ";" [CFWS] key-value-pair ) [";"] ; key-value-pair = key [CFWS] "=" ( dot-atom / quoted-string ) ; key = "client-ip" / "envelope-from" / "helo" / "problem" / "receiver" / "identity" / mechanism / "x-" name / name ; identity = "mailfrom" / "helo" / name ; ALPHA = %x41-5A / %x61-7A ; BIT = "0" / "1" ; CHAR = %x01-7F ; CR = %x0D ; CRLF = CR LF ; CTL = %x00-1F / %x7F ; DIGIT = %x30-39 ; DQUOTE = %x22 ; HEXDIG = DIGIT / "A" / "B" / "C" / "D" / "E" / "F" ; HTAB = %x09 ; LF = %x0A ; LWSP = *(WSP / CRLF WSP) ; OCTET = %x00-FF ; SP = %x20 ; VCHAR = %x21-7E ; WSP = SP / HTAB ; NO-WS-CTL = %d1-8 / %d11 / %d12 / %d14-31 / %d127 ; text = %d1-9 / %d11 / %d12 / %d14-127 / obs-text ; specials = "(" / ")" / "<" / ">" / "[" / "]" / ":" / ";" / "@" / "\" / "," / "." / DQUOTE ; quoted-pair = ("\" text) / obs-qp ; FWS = ([*WSP CRLF] 1*WSP) / obs-FWS ; ctext = NO-WS-CTL / %d33-39 / %d42-91 / %d93-126 ; ccontent = ctext / quoted-pair / comment ; comment = "(" *([FWS] ccontent) [FWS] ")" ; CFWS = *([FWS] comment) (([FWS] comment) / FWS) ; atext = ALPHA / DIGIT / "!" / "#" / "$" / "%" / "&" / "'" / "*" / "+" / "-" / "/" / "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~" ; atom = [CFWS] 1*atext [CFWS] ; dot-atom = [CFWS] dot-atom-text [CFWS] ; dot-atom-text = 1*atext *("." 1*atext) ; qtext = NO-WS-CTL / %d33 / %d35-91 / %d93-126 ; qcontent = qtext / quoted-pair ; quoted-string = [CFWS] DQUOTE *([FWS] qcontent) [FWS] DQUOTE [CFWS] ; obs-FWS = 1*WSP *(CRLF 1*WSP) ; obs-qp = "\" (%d0-127) ; obs-text = *LF *CR *(obs-char *LF *CR) ; obs-char = %d0-9 / %d11 / %d12 / %d14-127 ; I know that my grammer is incomplete and not able to parse ip6 mechanisms., but the RFC3513 dose not contain any grammar at all. But the following string v=spf1 mx mx:example.org -all should be parseable with the given grammar. The parser generated with aparse dose not seem to recognize the end of the domain. Is this a Problem with the grammer or the parser generator ? If this is a generator problem can anybody recomend a alternative to aparse ?
- Problem with RFC 4408 jannisohms
- Re: Problem with RFC 4408 Scott Kitterman