[ietf-822] Question about line folding and maximum line length

Bryan Frimin <bryan@frimin.fr> Thu, 06 May 2021 13:52 UTC

Return-Path: <bryan@frimin.fr>
X-Original-To: ietf-822@ietfa.amsl.com
Delivered-To: ietf-822@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 1196D3A2310 for <ietf-822@ietfa.amsl.com>; Thu, 6 May 2021 06:52:19 -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=frimin.fr
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 h8LHaaym9oNu for <ietf-822@ietfa.amsl.com>; Thu, 6 May 2021 06:52:14 -0700 (PDT)
Received: from mail1.frimin.fr (mail1.frimin.fr [IPv6:2001:19f0:5001:1b88:5400:2ff:fea6:40a5]) (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 E05A23A230E for <ietf-822@ietf.org>; Thu, 6 May 2021 06:52:13 -0700 (PDT)
Received: from i1.frimin.fr (i1.frimin.fr [2001:19f0:6801:690:5400:2ff:fea8:7091]) by mail1.frimin.fr (OpenSMTPD) with ESMTPSA id 61de9db5 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <ietf-822@ietf.org>; Thu, 6 May 2021 13:52:10 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=frimin.fr; s=1585753420; t=1620309128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=Ymbw1L4YJg5yzVQszi5h1DzFsENPij6TsyJd2xSl7j0=; b=HiAEQYj4+9RqxZQ7c62Z3W1thfs+BzALDIHedqn7c120Yh+bFpKGXzIm0c2ZiPJ3L7tFbv MUXpV3M9eZk6SrZonuZEXz2uyogdS4GFOstid2wGreVSwZcXUaV/FxuZEH6TIBS3RSWS3K +aulnjhjCVfaxeg58t2wiKR4WmOXaC8=
Received: by i1.frimin.fr (OpenSMTPD) with ESMTPSA id e7f5cc88 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for <ietf-822@ietf.org>; Thu, 6 May 2021 13:52:08 +0000 (UTC)
From: Bryan Frimin <bryan@frimin.fr>
To: ietf-822@ietf.org
Date: Thu, 06 May 2021 15:52:08 +0200
Message-ID: <87eeekq8af.fsf@workstation.frimin.fr>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
Archived-At: <https://mailarchive.ietf.org/arch/msg/ietf-822/ejlUrr6k6H8LIBf86koIWJ8m50Y>
Subject: [ietf-822] Question about line folding and maximum line length
X-BeenThere: ietf-822@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Discussion of issues related to Internet Message Format \[RFC 822, RFC 2822, RFC 5322\]" <ietf-822.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ietf-822>, <mailto:ietf-822-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ietf-822/>
List-Post: <mailto:ietf-822@ietf.org>
List-Help: <mailto:ietf-822-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ietf-822>, <mailto:ietf-822-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 06 May 2021 13:52:19 -0000

Hello everyone,

I am implementing an e-mail client. I have to implement the SMTP
protocol, starting with the internet message format defined by RFC
5322[1].

After reading the RFC, I found two points that are not clear to me.

1. The maximum line length.
RFC 5322 section 2.1.1[2] describes two possible line length limits. The
historical one, 78 characters, and the new one, 998 characters. Is the
historical limit still relevant for an email client in 2021, or can I
just use the new one?

2. The long line folding mechanism.
RFC 5322 section 2.2.3[3] defines a folding mechanism for long header
fields. But it does define whether it is possible to fold a header field
name longer than the limit (yes it is an edge case, but it could
happen). And folding can only be done if a lexical token or a space is
present. So what about values without any separator ?

Regards,

[1] https://tools.ietf.org/html/rfc5322
[2] https://tools.ietf.org/html/rfc5322#section-2.1.1
[3] https://tools.ietf.org/html/rfc5322#section-2.2.3

-- 
Bryan Frimin
https://www.frimin.fr
bryan@frimin.fr