From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id yD/jAHWs/F/lHQAA0tVLHw (envelope-from ) for ; Mon, 11 Jan 2021 19:52:21 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id COA5OHSs/F/1ZAAAB5/wlQ (envelope-from ) for ; Mon, 11 Jan 2021 19:52:20 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (2048 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id A1C7A9403C5 for ; Mon, 11 Jan 2021 19:52:20 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 29BFF29E26; Mon, 11 Jan 2021 14:52:14 -0500 (EST) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [IPv6:2a0b:5c81:1c1::37]) by mail.notmuchmail.org (Postfix) with ESMTPS id E77C21FBCC for ; Mon, 11 Jan 2021 14:52:11 -0500 (EST) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 57F341B00257 for ; Mon, 11 Jan 2021 21:52:09 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1610394729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2pfDuHjL3BM5fE6L321hmvcVE3BqNeqsSkAM4Fdla5g=; b=Uut5POoePBRsmTS8kHMhuKuhohNJuOZ+tVcmFpt53lOkPJfaagXL3nrF7LRJNohXJB0BUL mJAVQ4Elq+spoVSESEMixDwALeTsJl27Jjr5wsIGm6Pq90FMw1fYpDQlQIThuDUPHkjakq CqJkw1SIp7xl68/DerpxgIIDj5RvsKIzz0ffsA0dewJgzGCH+9VUZ4mSauqb3TC6pD/JJj tDn99NUj8s7T6Qz8MOq05twnf3mchoKWW1ML9BInrvU3Hcjq2z9x7oeQfEgg07XDnELYJf 3i8M0ep7V9gPD7trwFqBrDhCETdUa56drsxqTfYwqCvVYFClhDBirsmYA6kszQ== From: Tomi Ollila To: notmuch@notmuchmail.org Subject: Re: [PATCH 0/4] emacs: avoid type errors due to nil as content-type In-Reply-To: <20210110184722.29294-1-jonas@bernoul.li> References: <20210110184722.29294-1-jonas@bernoul.li> User-Agent: Notmuch/0.31.3+70~g95b022c (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1610394729; a=rsa-sha256; cv=none; b=BYOIt7zRtoF8kb+Je+w3l6AP93z/lHhTSc0IWjnuVzyl7XjNncX29N8V6T+aY80BgX6SpM 6IuPwLVdVj3bK2/OFe0Oo0dy9g39wbht/0BdBGjpGWY7NHQHJ2hHtHh5ztHzr/Ed0qn1Sg +twdBLjYglSZdPbBzFP1Bq0QztwLkkJL5uh1Uy5xiBZZe5bozcnHV7qPLC4T095rNotGjl lnPojIZIpQ21MrkyWaZsfj94atTqK4sOI72okZP/KBIO9pnwPAg6GS1AeYU+BMIrQtKIbw +ww/f/Sj1WjfGOxmRkswExqDGu2hku3MOtwXH7y7kcPpZ8lYEMuV3dDCSq5lMw== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1610394729; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=2pfDuHjL3BM5fE6L321hmvcVE3BqNeqsSkAM4Fdla5g=; b=m3bz8fmGL31bA99Yec/QIClwGkUTyb4NCgTmLjIBG9gPeav6BVRJYLZvWAhUmMRGUmSID1 tM4ALOgV7akLxeNYQ7Hg2kgU2aj21x9oTeDy1N7Q3nppYBh8ce6U85a3/LYAVwzZQ7lITU Higkb+UDN9cOHRIiG+uogq3kZNEUU6y5agr3oWQrPe6SxQLDRj+Vk7ishlNOCiaz8tUcyz fchWQI3+CvdLFEbUwOR24tWRzsSWi6P43LjoP4lr7zae+gL7E/GiQyrM2EucK9xj03v+KH ksxGF5tOu+F195/9v7PInZaO4EOmQ8LUUZPcwUJBDT0R9TYcd01cloYPmKG18Q== Message-ID-Hash: YQBZDHSGJ63QB74R7EQ4YJ5G6OFSPIDK X-Message-ID-Hash: YQBZDHSGJ63QB74R7EQ4YJ5G6OFSPIDK X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 1.06 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=iki.fi header.s=lahtoruutu header.b=Uut5POoe; arc=reject (signature check failed: fail, {[1] = sig:iki.fi:reject}); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: A1C7A9403C5 X-Spam-Score: 1.06 X-Migadu-Scanner: scn0.migadu.com X-TUID: QF7ZxjvdaLL5 On Sun, Jan 10 2021, Jonas Bernoulli wrote: > The fourth commit tries to address the issue raised in > id:87k0sxa6c3.fsf@fifthhorseman.net. > > The output of "notmuch show --format=sexp --format-version=4" > may contain `:content-type' entries with `nil' as the value, > when it fails to detect the correct value. Account for that > in a few places where we would otherwise risk a type error. > > The other three commits cleanup the code I had to look at to do > the above, because I just can't help myself. > > This does not apply without first applying > id:20201214162401.19569-1-jonas@bernoul.li. Perhaps this series still applies on top of that series from 2020-12-14, but perhaps one should apply it on top of series (from 2021-01-10): id:20210110140112.25930-2-jonas@bernoul.li Meaning emails in range id:20210110140112.25930-2-jonas@bernoul.li ... id:20210110140112.25930-37-jonas@bernoul.li (also visible in https://nmbug.notmuchmail.org/status/) Note that messages 20210110140112.25930-11-jonas@bernoul.li and 20210110140112.25930-12-jonas@bernoul.li have base64 -encoded content, with CRLF line endings so those don't apply as is, but CR's from the encoded content must be deleted. I used a hack to do so, appended to the end of this email; David has done something that is more robust, and perhaps from that we could get a tool to be added in devel/ which could do this in the future. Both of these series applied cleanly, and I will start using those in my emacs mua. I like these changes and hope these can be applied soon. > > Jonas Tomi Usage: ./rmcr-base64.pl < input.mbox > output.mbox --8<----8<----8<----8<----8<----8<----8<----8<-- #!/usr/bin/perl # -*- mode: cperl; cperl-indent-level: 4 -*- use 5.8.1; use strict; use warnings; use MIME::Base64; while () { print $_; if (/^Content-Transfer-Encoding: base64/) { while () { print $_; last if /^\s*$/ } my @lines; while () { last if /^\s*$/; push @lines, $_ } my $decoded = decode_base64 join('', @lines); $decoded =~ tr/\r//d; print(encode_base64 $decoded); print "\n" } }