Re: [ietf-smtp] Valid RFC5322 address

Ned Freed <ned.freed@mrochek.com> Sun, 03 May 2020 15:15 UTC

Return-Path: <ned.freed@mrochek.com>
X-Original-To: ietf-smtp@ietfa.amsl.com
Delivered-To: ietf-smtp@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 9E3AC3A0E6A for <ietf-smtp@ietfa.amsl.com>; Sun, 3 May 2020 08:15:54 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.099
X-Spam-Level:
X-Spam-Status: No, score=-2.099 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=mrochek.com
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 JTno9pBtBaLO for <ietf-smtp@ietfa.amsl.com>; Sun, 3 May 2020 08:15:53 -0700 (PDT)
Received: from plum.mrochek.com (plum.mrochek.com [172.95.64.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 1DA0D3A0E28 for <ietf-smtp@ietf.org>; Sun, 3 May 2020 08:15:53 -0700 (PDT)
Received: from dkim-sign.mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01RKFEP0GC1C006KSR@mauve.mrochek.com> for ietf-smtp@ietf.org; Sun, 3 May 2020 08:10:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mrochek.com; s=201712; t=1588518649; bh=DUaUkSCh5BaZrkzsbbN0GlbhltoH2FoGM3qtx4FBghY=; h=Cc:Date:From:Subject:In-reply-to:References:To:From; b=HtN2qM9tVNgQ29bQsVoHeCKFwsSa/NB5/CiDtRd9s8maZXLc6dI1mekVgkHNPi4UA SrwxGzu0/9ZjHrS3i3xe/CBgdEeRCM9dZ4juxTZrSaELoHIpAaiKUJq6brItYcQgPp K0zC99qjRcXDCJXxWa4NqDsBe0fpOHoDpR6Cfu2w=
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: TEXT/PLAIN; CHARSET=us-ascii; Format=flowed
Received: from mauve.mrochek.com by mauve.mrochek.com (PMDF V6.1-1 #35243) id <01RKCJ3X0XR40055BV@mauve.mrochek.com>; Sun, 3 May 2020 08:10:44 -0700 (PDT)
Cc: SMTP Interest Group <ietf-smtp@ietf.org>
Message-id: <01RKFEOXG3E40055BV@mauve.mrochek.com>
Date: Sun, 03 May 2020 08:03:10 -0700 (PDT)
From: Ned Freed <ned.freed@mrochek.com>
In-reply-to: "Your message dated Sun, 03 May 2020 10:51:48 -0400" <5EAEDA84.1050408@isdg.net>
References: <5EAEDA84.1050408@isdg.net>
To: Hector Santos <hsantos=40isdg.net@dmarc.ietf.org>
Archived-At: <https://mailarchive.ietf.org/arch/msg/ietf-smtp/7iLAFfVM0yIS2-3Kse9MpYNr8LE>
Subject: Re: [ietf-smtp] Valid RFC5322 address
X-BeenThere: ietf-smtp@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Discussion of issues related to Simple Mail Transfer Protocol \(SMTP\) \[RFC 821, RFC 2821, RFC 5321\]" <ietf-smtp.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf-smtp>, <mailto:ietf-smtp-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ietf-smtp/>
List-Post: <mailto:ietf-smtp@ietf.org>
List-Help: <mailto:ietf-smtp-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf-smtp>, <mailto:ietf-smtp-request@ietf.org?subject=subscribe>
X-List-Received-Date: Sun, 03 May 2020 15:15:55 -0000

> Is this a valid address?

> 08:04:33.934 C: MAIL
> FROM:<github.agent:.github-hookshot/7431eee@winserver.com>
> 08:04:34.712 S: 250 2.1.0 Ok

> with the ':' and also '/' ??

No. The / is fine, but : is a special, and has to be quoted to be used in a
local part. RFC 5322 section 3.2.3.

> It appears to be accepted by various servers, including my own.

Our server doesn't allow it.

> This is related to a new project of handling a GitHub Webhook HTTP
> notifications sent to my web server.  The handler will the payload as
> a local message using the address:

> From: github agent: github-hookshot/7431eee

> That comes from an operator defined macro:

> From: github agent: {GITHUB-AGENT}

> Which is read from the JSON payload.

> If the setup happens to send the notification to an email address,
> then the mail is exported for SMTP to sent out.

> So I need to know if the address is valid. Its hard to decipher
> whether it is or not from the RFC5322/RFC5321 BNF. It seems to read
> the ':' and '/' characters are valid.

   addr-spec       =   local-part "@" domain

   local-part      =   dot-atom / quoted-string / obs-local-part

   dot-atom        =   [CFWS] dot-atom-text [CFWS]

   dot-atom-text   =   1*atext *("." 1*atext)

   atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
                       "!" / "#" /        ;  characters not including
                       "$" / "%" /        ;  specials.  Used for atoms.
                       "&" / "'" /
                       "*" / "+" /
                       "-" / "/" /
                       "=" / "?" /
                       "^" / "_" /
                       "`" / "{" /
                       "|" / "}" /
                       "~"

Note tha absence of ":" in atext. The only way a ":" in a local-part
is within a quoted-string:

   quoted-string   =   [CFWS]
                       DQUOTE *([FWS] qcontent) [FWS] DQUOTE
                       [CFWS]

   qcontent        =   qtext / quoted-pair

   qtext           =   %d33 /             ; Printable US-ASCII
                       %d35-91 /          ;  characters not including
                       %d93-126 /         ;  "\" or the quote character
                       obs-qtext


				Ned