Re: [ietf-smtp] quoted-unprintable ?

John R Levine <johnl@taugh.com> Thu, 25 March 2021 22:45 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 [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id C42983A0D63 for <ietf-smtp@ietfa.amsl.com>; Thu, 25 Mar 2021 15:45:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.1
X-Spam-Level:
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=Ckz9o13n; dkim=pass (2048-bit key) header.d=taugh.com header.b=KIJKheBd
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 DhQuodb0tDfi for <ietf-smtp@ietfa.amsl.com>; Thu, 25 Mar 2021 15:45:47 -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 8565B3A0D39 for <ietf-smtp@ietf.org>; Thu, 25 Mar 2021 15:45:47 -0700 (PDT)
Received: (qmail 25282 invoked from network); 25 Mar 2021 22:45:46 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=iecc.com; h=date:message-id:from:to:cc:subject:in-reply-to:references:mime-version:content-type; s=62c0.605d129a.k2103; bh=2UR9ujVyj9G1ME9MHOtlIucmwSllwkaWVRFIgHJeq4k=; b=Ckz9o13ne3fo80XFcgjmgwXmQnIye5kPD9LzB4irwcmmFNEbTPESj0VUu6tV1yYwj5Hor9BFhZWv22jkzWEUbj+HySj45ox/vcUo9EuUg/O0vb0eS7kRDPpQlOiWRkCt8xrN5/Wt8Nf/Eu4oXykTAqAfd7oYFDSezm4uAlc2AU+0iDC+2hhWjYRy4XYtZ0WitP081NneT4hYCgtrZGqEJaVvl11l19vLhTKd3RRwd/xyRW659BiPFX+Ys8aeDZHv6vuGK27inAHeCU+7ct0Z9RmPYUOJ0uuS8wAfP259ljCjauUcBF99UZ1juOZW3UBBFaWZ+BPFzoWyCHaBxbuOGQ==
DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=taugh.com; h=date:message-id:from:to:cc:subject:in-reply-to:references:mime-version:content-type; s=62c0.605d129a.k2103; bh=2UR9ujVyj9G1ME9MHOtlIucmwSllwkaWVRFIgHJeq4k=; b=KIJKheBdDcdHcsP6ULkGHxcU1jQLlUHenhQI67tl/yjl7HJwoAYoJGmTXV844r0f1668Z+fC+qPIDWHz/eUc+WVTu/Ho2Y0v4vxwLalh7hKMXSZWChi8Gzsi9O6ozVrNp0OZ01u/Oa6UMjLV3AKCjJmnf01USJqCRSptNCcR8i5XsGTO72OjlHNw/FadZKe8nDtRgKfZXSEA3tWZGYq72o3QBAslCi1u/tnJOQvrCOMyrNBhn4hucHlvRTQ2FACLHzPB0nkkQKpMZxvXXjPPR7WYfFcCtzEDoJ9J16UYEftfLw1hXQ2x97zmRd35RALcGkKeNr0mQyETsdn7zXGBrQ==
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; 25 Mar 2021 22:45:45 -0000
Received: by ary.qy (Postfix, from userid 501) id DB05B7144647; Thu, 25 Mar 2021 18:45:45 -0400 (EDT)
Received: from localhost (localhost [127.0.0.1]) by ary.qy (Postfix) with ESMTP id 6016D7144629; Thu, 25 Mar 2021 18:45:45 -0400 (EDT)
Date: Thu, 25 Mar 2021 18:45:45 -0400
Message-ID: <ec115a16-71c4-c8b1-bc6-768eb964c66a@taugh.com>
From: John R Levine <johnl@taugh.com>
To: Ned Freed <ned.freed@mrochek.com>, John R Levine <johnl@taugh.com>
Cc: Tony Finch <dot@dotat.at>, ietf-smtp@ietf.org
X-X-Sender: johnl@ary.qy
In-Reply-To: <01RX3298GE140085YQ@mauve.mrochek.com>
References: <20210321174103.BB02470D9908@ary.qy> <01RWXI9W6HXE0085YQ@mauve.mrochek.com> <80798a9f-d15-b647-e387-f83e4986caa6@dotat.at> <5e0f746-4e7c-f370-9f37-6dd9f73f2d86@taugh.com> <01RX3298GE140085YQ@mauve.mrochek.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="US-ASCII"; format="flowed"
Archived-At: <https://mailarchive.ietf.org/arch/msg/ietf-smtp/pW9tWBqQkL6PCLI5SlascSk4dFA>
Subject: Re: [ietf-smtp] quoted-unprintable ?
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: Thu, 25 Mar 2021 22:45:59 -0000

>> On Thu, 25 Mar 2021, Tony Finch wrote:
>> > Stuart Cheshire and Mary Baker have a super elegant binary escaping scheme
>> > called "consistent overhead byte stuffing" (COBS) that has a guaranteed
>> > overhead of less than 1%.
>> >
>> > http://www.stuartcheshire.org/papers/COBSforToN.pdf
>
>> That's quite clever, although it only avoids a single value and it's not
>> immediately obvious how to extend it to multiple values.  Applying it
>> iteratively for different values wouldn't work.
>
> If you really think this is a problem worth solving, the simplest way to do 
> it is encrypt the dats using a fast encryption scheme and a fixed key. 
> Encryption pretty much guarantees that there won't be too many of any particular byte
> value.

Look at the paper, which is solving a different problem.  He's dealing 
with a situation where there is one special byte (zero in his example) 
which is used to frame blocks, and this twiddles the data in a way that 
gets rid of zeros very cheaply.

Our problem is different. There's at least one value we need to avoid 
(zero), and two that we need to quote when they're in the data, and ignore 
otherwise (CR and LF).  COBS doesn't help either with quoting CR and LF 
when they are significant or ignoring them when they are not.

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