[ietf-smtp] How is EAI mail implemented ?

John R Levine <johnl@taugh.com> Tue, 15 June 2021 17:32 UTC

Return-Path: <johnl@taugh.com>
X-Original-To: ietf-smtp@ietfa.amsl.com
Delivered-To: ietf-smtp@ietfa.amsl.com
Received: from localhost (localhost []) by ietfa.amsl.com (Postfix) with ESMTP id 519873A3775 for <ietf-smtp@ietfa.amsl.com>; Tue, 15 Jun 2021 10:32:45 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.1
X-Spam-Status: No, score=-2.1 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_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=iecc.com header.b=ellieh4X; dkim=pass (2048-bit key) header.d=taugh.com header.b=fpEXIH0f
Received: from mail.ietf.org ([]) by localhost (ietfa.amsl.com []) (amavisd-new, port 10024) with ESMTP id BBxWU1Ib_BeN for <ietf-smtp@ietfa.amsl.com>; Tue, 15 Jun 2021 10:32:39 -0700 (PDT)
Received: from gal.iecc.com (gal.iecc.com [IPv6:2001:470:1f07:1126:0:43:6f73:7461]) (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 8C1833A3778 for <ietf-smtp@ietf.org>; Tue, 15 Jun 2021 10:32:39 -0700 (PDT)
Received: (qmail 18435 invoked from network); 15 Jun 2021 17:32:36 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=iecc.com; h=date:message-id:from:to:subject:mime-version:content-type; s=4801.60c8e434.k2106; bh=s+wUQ99hq+Y+zzknOKJ5DPY2hszKfnDy6FbkNhHbjfs=; b=ellieh4X8ll7h8HSjenbozXAxRsPdG9hAv1fv/Da6yNHo90eRJYCHnxXQExBVeXbHS2HltSp4Wkv5FuxR0pwjasbQ6QU5yZeuFDhX3BixasmIp1d+3hGHSNad6Q1C4ZJnnvrzUbj+RmbB7I6shreOqJwzbVzKnyWpOoTEtSxrEawAm4XXwNzl3j08nNK4tBcTFoF6Vkpw+TH2TOWfcqW74g4372UWaPCBhBPv4H7XsOlz3o1VmPavqSgZdoKT3UFlOoFh6t5tn2xGPZMoPEIF46JE6y4Rg1G/LTHLqUsevVGMrOYX1qLs68W6oNu1Pjm9lhxHiTYOhnFg+hcdJwRlg==
DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=taugh.com; h=date:message-id:from:to:subject:mime-version:content-type; s=4801.60c8e434.k2106; bh=s+wUQ99hq+Y+zzknOKJ5DPY2hszKfnDy6FbkNhHbjfs=; b=fpEXIH0fDb0AlzGVBnKNGAZdQGh3iuGZNtRvzcvRNW+y097GU0tLe4F0YIcEDXHqw7gZVlmf4IKaw3iQIk0V6hcsBB8kUN59eC+yGJkLtIj4FYTe8Tn8ee3wWAI9BkLW5lzUiC/jJByOyUQOiWg5pyBm/ct0PnuC8BaygsAuzhblXFEdaQkvyX1t4ypvVArOYG/cFypHzzWdSBzHRLsELGofZALqeGl2be+7WNiGDWVyL6Pu27Pm9cACOVZy8Wtd5HPnmtGvDKZgKKebyUGXspVSjd5ALPqkqg2UVzqKLA0mTFEfgf0JWnPzFXaw66ZYjNfmNFLvl6bmbG/eSern2Q==
Received: from ary.qy ([IPv6:2001:470:1f07:1126::78:696d:6170]) by imap.iecc.com ([IPv6:2001:470:1f07:1126::78:696d:6170]) with ESMTPS (TLS1.2 ECDHE-RSA AES-256-GCM AEAD) via TCP6; 15 Jun 2021 17:32:36 -0000
Received: by ary.qy (Postfix, from userid 501) id A34CF11373A2; Tue, 15 Jun 2021 13:32:34 -0400 (EDT)
Received: from localhost (localhost []) by ary.qy (Postfix) with ESMTP id 39D351137375 for <ietf-smtp@ietf.org>; Tue, 15 Jun 2021 13:32:34 -0400 (EDT)
Date: 15 Jun 2021 13:32:34 -0400
Message-ID: <5bb26c2f-a94d-ccaf-8fc1-51684f25f48@taugh.com>
From: "John R Levine" <johnl@taugh.com>
To: "ietf-smtp" <ietf-smtp@ietf.org>
X-X-Sender: johnl@ary.qy
MIME-Version: 1.0
Content-Type: text/plain; format=flowed; charset=US-ASCII
Archived-At: <https://mailarchive.ietf.org/arch/msg/ietf-smtp/UHO5mpDbOCn8h0eq8H4erZFhe6k>
Subject: [ietf-smtp] How is EAI mail implemented ?
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: Tue, 15 Jun 2021 17:32:45 -0000

This is sort of a followup to the discussion abut domain names in Received 
lines in EAI messages.

RFC 6531 describes a model where EAI mail is conceptually parallel to 
ASCII mail -- clients tag incoming EAI messages with SMTPUTF8 keywords, 
those EAI messages can only be relayed to servers that offer SMTPUTF8, and 
so forth.  Having looked at a bunch of EAI mail software, nobody 
actually implements it that way.

Since all computers handle 8-bit bytes, mail software generally handles 
8-bit data without doing anything special.  You have to change the code 
that does DNS lookups to turn U-labels into A-labels, but that's about it.

On my system I turn addresses into A-labels on the way in, and back into 
U-labels on the way out (only if there is a UTF-8 local part) and handle 
all the local routing and deliveries with A-labels.  But a lot of MTAs 
don't even do that, they just allow any IDN in the domain, and if you want 
the U-label and A-label versions of an address to deliver to the same 
place, you have to configure them both.

Nobody I've seen tags messages as EAI in their internal queues.  On 
outgoing mail, they check on the fly to see if it's an EAI message: 
non-ASCII characters in the envelope or message headers (Exim doesn't even 
look at the headers, and says that's not a bug.)  A lot of MTAs add the 
SMTPUTF8 MAIL FROM tag to all outgoing mail to servers that offer 
SMTPUTF8, because why not.  I think they all notice if an EAI message is 
sent to a non-EAI server, and a few in that case do odd things like 
turning a UTF-8 local part into a MIME encoded word in the envelope.

This approach is a lot easier to code than trying to tag all the queued 
messages, and it can deliver more mail if, e.g., an incoming message has 
an ASCII bounce address and UTF-8 recipients but is relayed to an ASCII 
recipient, the relay doesn't need EAI.

When looking at IMAP and POP servers, again, since computers all handle 
8-bit data, you get most of the way there for free.  I haven't found any 
IMAP servers with UTF8=ACCEPT or POP with UTF8 that really works, but I've 
found plenty with LOGIN and AUTHENTICATE commands that take UTF-8 
strings, and IMAP searches with the complex old character encoding work 
remarkably well.  It often seems even to find strings in unencoded UTF-8 
headers which I wasn't expecting, perhaps again something that works by 

None of this means the RFCs have to change but it might be time for an 
applicability statement or something about how EAI is likely to coexist 
with ASCII mail for a long time.

John Levine, johnl@taugh.com, Taughannock Networks, Trumansburg NY
Please consider the environment before reading this e-mail. https://jl.ly