From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iC9sCc449V/mJQAA0tVLHw (envelope-from ) for ; Wed, 06 Jan 2021 04:13:02 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id GMI+Bc449V9LJQAA1q6Kng (envelope-from ) for ; Wed, 06 Jan 2021 04:13:02 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (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 337C49401C0 for ; Wed, 6 Jan 2021 04:13:01 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 8164829C90; Tue, 5 Jan 2021 23:12:53 -0500 (EST) Received: from che.mayfirst.org (unknown [162.247.75.117]) by mail.notmuchmail.org (Postfix) with ESMTPS id C7FED28539 for ; Tue, 5 Jan 2021 23:12:50 -0500 (EST) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1609906367; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=ClarEMSfBl5OLz+gJ6kSxhxeDsaxcpUUW7w1nLJ1D+U=; b=zPonwmFfAjsmru8WQTUj3dYTpaFA+ZFRxeyqwRdfXGUZv5FPwrreF1dg86ssrau9uo+8C DJHkyzQ8DzG4MxdDw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1609906367; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=ClarEMSfBl5OLz+gJ6kSxhxeDsaxcpUUW7w1nLJ1D+U=; b=ccVNFwC424hr6kvlPArOuILLqJ25hOqVMuPCYQXx9qeKqPoWymgdNEdgqrCZa4M+4/kOY SfhuUziC6xcK8GYvELiyUyHjV/IVrgl4Mm7jzQ5LQ3YUGl6Db3yBs2hQU6cxe9stdypjvAU fgOErw94StFDHD8EGkl4VlvtO5bijg9IiQIwWPoSm/d3mql7Fx/Uk/NBAYtmCqdW4CADshP PI2VM2Ceey0Lq33N4Im4rvaYWe1+OcAfIbP2tijiaXJU331W4n0PyAZ96mz4vMRP2mmA7NR teC1ivMueVcZs1yPesD5iIvOnOSNtaP7h+X1g1lsk+UieNsKotEVflbnM09A== Received: from fifthhorseman.net (lair.fifthhorseman.net [108.58.6.98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by che.mayfirst.org (Postfix) with ESMTPSA id C60E1F9A7; Tue, 5 Jan 2021 23:12:45 -0500 (EST) Received: by fifthhorseman.net (Postfix, from userid 1000) id DDC1220327; Tue, 5 Jan 2021 17:00:41 -0500 (EST) From: Daniel Kahn Gillmor To: Jonas Bernoulli , Tomi Ollila , Notmuch Mail Subject: Re: [PATCH] emacs/notmuch-show: Work around errors where a part lacks a content-type In-Reply-To: <87im8c9zru.fsf@bernoul.li> References: <87wnwu8tzf.fsf@fifthhorseman.net> <20210103183154.1207696-1-dkg@fifthhorseman.net> <87im8c9zru.fsf@bernoul.li> Autocrypt: addr=dkg@fifthhorseman.net; prefer-encrypt=mutual; keydata= mDMEXEK/AhYJKwYBBAHaRw8BAQdAr/gSROcn+6m8ijTN0DV9AahoHGafy52RRkhCZVwxhEe0K0Rh bmllbCBLYWhuIEdpbGxtb3IgPGRrZ0BmaWZ0aGhvcnNlbWFuLm5ldD6ImQQTFggAQQIbAQULCQgH AgYVCgkICwIEFgIDAQIeAQIXgAIZARYhBMS8Lds4zOlkhevpwvIGkReQOOXGBQJd5Hw3BQkFpJWB AAoJEPIGkReQOOXGDYEA/j0ERjPxDleKMZ2LDcWc/3o5cLFwAVzBKQHppu0Be5IWAP0aeTnyEqlp RTE7M8zugwkhYeUYfYu0BjecDUMnYz6iDLgzBF3kewUWCSsGAQQB2kcPAQEHQK1IuW0GZmcrs2mx CYMl8IHse0tMF8cP7eBNXevrlx2ZiPUEGBYIACYCGwIWIQTEvC3bOMzpZIXr6cLyBpEXkDjlxgUC XeR7TwUJAiGl/gCBdiAEGRYIAB0WIQQsv6x2UaqQJzY+dXHEDyVUMvKBDwUCXeR7BQAKCRDEDyVU MvKBD7KmAQCHs+7588C4jto6fMje0Nu97zzoppjJM7lrGF2rVnbHvwD+MgmGUbHzPSUrTWnZBQDi /QM595bxNrBA4N1CiXhs2AMJEPIGkReQOOXGpp0BAM7YeBnt/UNvxJAGm4DidSfHU7RDMWe6Tgux HrH21cDkAQC9leNFXJsQ7F2ZniRPHa8CkictcQEKPL8VCWpfe8LbArg4BF3ke5wSCisGAQQBl1UB BQEBB0Cf+EiAXtntQMf51xpqb6uZ5O0eCLAZtkg0SXHjA1JlEwMBCAeIfgQYFggAJhYhBMS8Lds4 zOlkhevpwvIGkReQOOXGBQJd5HucAhsMBQkCIaVkAAoJEPIGkReQOOXGdYcBANYnW7VyL2CncKH1 iO4Zr0IwfdIv6rai1PUHL98pVi3cAP9tMh85CKGDa0Xi/fptQH41meollLW5tLb/bEWMuUNuBQ== Date: Tue, 05 Jan 2021 17:00:41 -0500 Message-ID: <87y2h76o3a.fsf@fifthhorseman.net> MIME-Version: 1.0 Message-ID-Hash: HSOLBIUHCUICVUDDJJS6Z453253YUVE2 X-Message-ID-Hash: HSOLBIUHCUICVUDDJJS6Z453253YUVE2 X-MailFrom: dkg@fifthhorseman.net 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: multipart/mixed; boundary="===============8733115178960810081==" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.58 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=fifthhorseman.net header.s=2019 header.b=zPonwmFf; dkim=fail (body hash did not verify) header.d=fifthhorseman.net header.s=2019rsa header.b=ccVNFwC4; dmarc=fail reason="SPF not aligned (relaxed)" header.from=fifthhorseman.net (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 337C49401C0 X-Spam-Score: -1.58 X-Migadu-Scanner: scn0.migadu.com X-TUID: 0/ydvyH9uH/6 --===============8733115178960810081== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain On Mon 2021-01-04 22:07:49 +0100, Jonas Bernoulli wrote: > There are other places in the elisp code where the `:content-type' is > assumed to be a string, so fixing it just here doesn't cut it. To fix > it for everyone, "notmuch show..." should probably take care of falling > back to some sane default if the type cannot be determined. the only two "sane defaults" would be either "text/plain" or "application/octet-stream", but the circumstances in which they are appropriate might differ. e.g. a the top level of a message (or the top level of a message/rfc822 subpart), the "sane default" would be "text/plain" (because that's how messages by MIME-ignorant mailers look, and they should still be readable text). But a subpart without a Content-Type designation should maybe default to "application/octet-stream", or (even fancier) maybe a guess based on other part headers, discovered filenames, or by sniffing content (yikes, there be dragons). All that said, i think fixing all the places in the elisp code is the safer route, because the elisp code can't guarantee what the local version of notmuch will do. At the very least, if :content-type isn't a string, notmuch-show shouldn't choke and break the rendering of the thread. So i think we should identify all the places where :content-type is expected to be a string, and degrade gracefully if that is not how the field is populated. --dkg --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQQsv6x2UaqQJzY+dXHEDyVUMvKBDwUCX/ThiQAKCRDEDyVUMvKB Dwa4AQCN9QP87ituuG21LSNZ5DgocyLEcxpyOz6gbXDCG+N2DgD/WxCDks6df4EM RtJkF0xoTcEgn15pNgya4pXqKDYTuA0= =q6We -----END PGP SIGNATURE----- --=-=-=-- --===============8733115178960810081== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============8733115178960810081==--