Re: [ietf-822] base64 encoding in rfc2045...

Ned Freed <> Mon, 18 March 2019 15:24 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 3EBA112D827 for <>; Mon, 18 Mar 2019 08:24:50 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.001
X-Spam-Status: No, score=-2.001 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id waq3wRFnAcTA for <>; Mon, 18 Mar 2019 08:24:48 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id B4D101310FE for <>; Mon, 18 Mar 2019 08:24:41 -0700 (PDT)
Received: from by (PMDF V6.1-1 #35243) id <> for; Mon, 18 Mar 2019 08:19:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;; s=201712; t=1552922378; bh=NmFrk5XCWKwDM8ZguF9bYM1SNUxgFWDK0G8ESgBxKr0=; h=Cc:Date:From:Subject:In-reply-to:References:To:From; b=HOGnhwv10lF1d1QJ9l/H4gRqbDA7xZrQ0QOxr8j2xVVJxpqfWSOPMmrWf4r6oYQNC Mwp0VsT3Ab75Nd1zsmVVyW9r8s+1jw+cZwmDXmOnOMa/A3f5Gh+mxrjAE7gfqZ6zbn S0ALivnaXjTW2lFo+YsoCAYImPyF1X/j0iG+BdAo=
MIME-version: 1.0
Content-transfer-encoding: 7BIT
Content-type: TEXT/PLAIN; CHARSET=us-ascii
Received: from by (PMDF V6.1-1 #35243) id <>; Mon, 18 Mar 2019 08:19:35 -0700 (PDT)
Message-id: <>
Date: Mon, 18 Mar 2019 08:15:25 -0700 (PDT)
From: Ned Freed <>
In-reply-to: "Your message dated Sun, 17 Mar 2019 15:24:35 -0400" <15314.1552850675@turing-police>
References: <15314.1552850675@turing-police>
To: Valdis Kl=?utf-8?Q?=c4=93?=tnieks <>
Archived-At: <>
Subject: Re: [ietf-822] base64 encoding in rfc2045...
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Discussion of issues related to Internet Message Format \[RFC 822, RFC 2822, RFC 5322\]" <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 18 Mar 2019 15:24:50 -0000

> (Man.. I was around for rfc1341. You'd think that by now, there'd be
> few things that would give me a "Wait, what?" moment...)

> So over on another list, a discussion arose of what an MUA should do
> if it receives a base64-encoded mail that's been altered. (In this case,
> it's mailing list software that's blindly stuck a "you received this because"
> footer onto a mail that was UTF-8/base64)

> And when I went to go cite chapter and verse, I discovered some text that
> seemed to contradict itself - OK for a religious text. An RFC? Not so much.

>    The encoded output stream must be represented in lines of no more
>    than 76 characters each.  All line breaks or other characters not
>    found in Table 1 must be ignored by decoding software.  In base64
>    data, characters other than those in Table 1, line breaks, and other
>    white space probably indicate a transmission error, about which a
>    warning message or even a message rejection might be appropriate
>    under some circumstances.

> I'm having a hard time matching even a lower-case 'must be ignored'
> up against "a warning message.. might be appropriate...". 

I see no conflict. The decoder doesn't let the garbage affect its output but
reporting the presence of garbage is recommended.

> Was the
> intent here "Just keep going, and optionally tell the recipient that everything
> from this point on is pure zorkum-blattum"?

More or less.

> Personally, I'm of the opinion that in reality, encountering a '=' is
> sufficient grounds for stopping right there, and also punting if a null line is
> encountered, because the chances it's a unintended appended text is much higher
> than a properly functioning base64 encoder generating an actual correct null
> line.

The text doesn't address the issue of what to do when an end marker  is
encountered (the marker isn't always present) but there's material after it. 
(Note that the material could consist of only valid base64 characters.)
Absent a recommendation, you are free to handle this case however you