[Extra] Email header / address parsing
Timo Sirainen <timo@sirainen.com> Tue, 01 September 2020 07:53 UTC
Return-Path: <timo@sirainen.com>
X-Original-To: extra@ietfa.amsl.com
Delivered-To: extra@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4A5AC3A0D78 for <extra@ietfa.amsl.com>; Tue, 1 Sep 2020 00:53:13 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 xfn0z_Fd0SnF for <extra@ietfa.amsl.com>; Tue, 1 Sep 2020 00:53:11 -0700 (PDT)
Received: from sirainen.com (mail.sirainen.com [94.237.26.55]) by ietfa.amsl.com (Postfix) with ESMTP id 273B93A0D77 for <extra@ietf.org>; Tue, 1 Sep 2020 00:53:10 -0700 (PDT)
Received: from [192.168.63.19] (unknown [212.247.176.200]) by sirainen.com (Postfix) with ESMTPSA id 7E0FE2B3C89 for <extra@ietf.org>; Tue, 1 Sep 2020 07:53:09 +0000 (UTC)
From: Timo Sirainen <timo@sirainen.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.1\))
Message-Id: <483BC400-403A-43CE-AEB5-EAE3B5B73080@sirainen.com>
Date: Tue, 01 Sep 2020 09:53:09 +0200
To: extra@ietf.org
X-Mailer: Apple Mail (2.3608.120.23.2.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/extra/sqRTdsV_DGBhHu2ghdCDFo_pM8Q>
Subject: [Extra] Email header / address parsing
X-BeenThere: extra@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Email mailstore and eXtensions To Revise or Amend <extra.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/extra>, <mailto:extra-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/extra/>
List-Post: <mailto:extra@ietf.org>
List-Help: <mailto:extra-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/extra>, <mailto:extra-request@ietf.org?subject=subscribe>
X-List-Received-Date: Tue, 01 Sep 2020 07:53:13 -0000
Hi, I was reading https://www.usenix.org/system/files/sec20-chen-jianjun.pdf and started wondering if IMAP should be handling some of this better. Especially for generating ENVELOPE. We could even still have time to add recommendations to IMAP4rev2? For example: 1) Errors while parsing the address syntax: I was wondering if it would be a good idea to indicate this by appending .INVALID suffix to domains of all of the addresses in the ENVELOPE reply? That way it would be at least clear that something is wrong. Otherwise different implementations could always do something slightly different when encountering errors, leading to trust problems. For example could be done with these kind of addresses: - From: user@attacker.com <user@real.com> --> either: user@real.com.INVALID --> or: user@attacker.com.INVALID - From: <user@attacker.com, <user@real.com> --> either: user@real.attacker.INVALID --> or: user@real.com.INVALID --> or: user@attacker.com.INVALID, user@real.com.INVALID 2a) Space preceding the first header name 2b) Space after From header: Again 2c) Folding space before ":" Not sure what exactly to do about all these. Don't parse these as valid headers? Or parse but append .INVALID for ENVELOPE? But that would work only for ENVELOPE headers. 3) Multiple From lines: Add all of these to ENVELOPE, as if they were all in a single From line.
- [Extra] Email header / address parsing Timo Sirainen
- Re: [Extra] Email header / address parsing John Levine
- Re: [Extra] Email header / address parsing Timo Sirainen
- Re: [Extra] Email header / address parsing John R Levine
- Re: [Extra] Email header / address parsing Timo Sirainen
- Re: [Extra] Email header / address parsing Arnt Gulbrandsen