From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id oEXvKk1X8V9IDAAA0tVLHw (envelope-from ) for ; Sun, 03 Jan 2021 05:34:05 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id SEBzJk1X8V8LbwAAbx9fmQ (envelope-from ) for ; Sun, 03 Jan 2021 05:34:05 +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 B7A8894043B for ; Sun, 3 Jan 2021 05:34:02 +0000 (UTC) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 494E129D2C; Sun, 3 Jan 2021 00:33:52 -0500 (EST) Received: from che.mayfirst.org (unknown [162.247.75.117]) by mail.notmuchmail.org (Postfix) with ESMTPS id E594E29CCF for ; Sun, 3 Jan 2021 00:33:49 -0500 (EST) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019; t=1609652025; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=0txW8m6FbOUFohBZhF8Iu/VyBv3xSfsdyIWwNq21TxA=; b=34UIj7AhaFlk4Lcen7DedEp3R8fFjvnV53CBQLMG3Io4tXJWqapeHvFEel35VUcQEmdOg dKbjzWJKwIC45qeAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fifthhorseman.net; i=@fifthhorseman.net; q=dns/txt; s=2019rsa; t=1609652025; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=0txW8m6FbOUFohBZhF8Iu/VyBv3xSfsdyIWwNq21TxA=; b=ztvn1iPSqIy6K1C9yJzC5yD3vuYQLaISUeGOq6o0YtxUfpuuWf56y/+YBQkhAWHTblbOM Os2+MgVSg6fL4x+TvD71aHJsg0WSFYhcAJHSPf7OTfFb8E8F3TfCOSGC88EEhYT0qVRgmGI 10MziEAIdnf8rFvOjHigl1mTR98fucU8MvE7TnZETOzksMQWJehp9ylxjsVuWELqZuBF6kN qDJM3uyVClEnBBKgElWA0jaxwMzD+OgWJQ78EpKELI7CbsqFoE6+JsIpD5CjZd8HxRfB+Pi qwhqbyG1p+/Uqcx9KXnfahBYG0LTZQfieMAyfyc8q5S+UH5V2UzLF8TMaWkQ== Received: from fifthhorseman.net (unknown [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 C6942F9A5; Sun, 3 Jan 2021 00:33:44 -0500 (EST) Received: by fifthhorseman.net (Postfix, from userid 1000) id 94BB82021E; Sun, 3 Jan 2021 00:33:41 -0500 (EST) From: Daniel Kahn Gillmor To: Jonas Bernoulli , Notmuch Mail Subject: Re: failure in emacs notmuch-show: notmuch-show--register-cids: Wrong type argument: char-or-string-p, nil In-Reply-To: <87ft3j8ybj.fsf@bernoul.li> References: <87k0sxa6c3.fsf@fifthhorseman.net> <87ft3j8ybj.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: Sun, 03 Jan 2021 00:33:40 -0500 Message-ID: <87wnwu8tzf.fsf@fifthhorseman.net> MIME-Version: 1.0 Message-ID-Hash: IU3NP7BTNXT6KXQ7T6GEDB2HC3HS2GQW X-Message-ID-Hash: IU3NP7BTNXT6KXQ7T6GEDB2HC3HS2GQW 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="===============2316951946874115296==" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.52 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=fifthhorseman.net header.s=2019 header.b=34UIj7Ah; dkim=fail (body hash did not verify) header.d=fifthhorseman.net header.s=2019rsa header.b=ztvn1iPS; 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: B7A8894043B X-Spam-Score: -1.52 X-Migadu-Scanner: scn1.migadu.com X-TUID: EaOBX+6JHfCZ --===============2316951946874115296== Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Jonas-- Thanks for the followup! i got the backtrace. On Sat 2021-01-02 10:47:44 +0100, Jonas Bernoulli wrote: >> notmuch-show--register-cids: Wrong type argument: >> char-or-string-p, nil > > With only that information my guess is that > (plist-get part :content-type) > returns nil, which "downcase" understandably isn't happy with. According to the backtrace, this is exactly right. the error is in (downcase nil). > The "part" plist comes from "notmuch show ..." in > "notmuch-query-get-threads", so one problem seems to be that that > can return nil as the type (as opposed to e.g. "unknown/unknown") > while this elisp function (and maybe others) expect a string. > >> 0 dkg@alice:~$ notmuch show --decrypt=3Dfalse --format=3Draw id:$message= id | email-print-mime-structure --use-gpg-agent >> =E2=94=94=E2=94=AC=E2=95=B4multipart/encrypted 27703 bytes >> =E2=94=9C=E2=94=80=E2=95=B4application/pgp-encrypted 11 bytes >> =E2=94=94=E2=94=80=E2=95=B4application/octet-stream inline [encrypted.a= sc] 23828 bytes >> =E2=86=A7 (decrypts to) >> =E2=94=94=E2=94=AC=E2=95=B4multipart/mixed 26085 bytes >> =E2=94=9C=E2=94=80=E2=95=B4text/plain 1028 bytes >> =E2=94=94=E2=94=AC=E2=95=B4message/rfc822 attachment [attachment.eml]= 24707 bytes >> =E2=94=94=E2=94=80=E2=95=B4text/plain 24510 bytes hm, this is interesting, upon further digging, the internal message/rfc822 part is base64-encoded. It has a "Content-Transfer-Encoding: base64" header, despite https://tools.ietf.org/html/rfc2046#section-5.2.1, which says: No encoding other than "7bit", "8bit", or "binary" is permitted for the body of a "message/rfc822" entity. So perhaps this message is malformed within the encryption envelope. Indeed, base64-decoding body of the attached message reveals that it has significantly more structure than the "text/plain" claim made by email-print-mime-structure above. So i've generated a simple message with a base64-encoded message/rfc822 part (but without the cryptographic wrapper), which is attached in a zip file below (i didn't want to attach it directly because it might break rendering). If you unzip it, and then: notmuch-insert < attached-message-b64-encoded.eml then in emacs: M-x notmuch-search id:attached-message-b64-encoded@mailscripts.example you should be able to replicate the failure. I admit i don't really understand why RFC 2046 *doesn't* accept that a message/rfc822 part might be base64-encoded, so i don't know whether the right answer is for notmuch to try b64-decode the message subpart itself, or to go ahead and ignore that "unpermitted" Content-Transfer-Encoding value. At any rate, whether this ends up being rendered as the sender intended to or not, notmuch-show shouldn't choke when processing it. Note that this has come up for a few other MUAs, including recently: thunderbird: https://bugzilla.mozilla.org/show_bug.cgi?id=3D333880 evolution: https://bugzilla.gnome.org/show_bug.cgi?id=3D651197 gmime: https://gitlab.gnome.org/GNOME/gmime/-/issues/1#note_373164 Makes me think that some library or tool recently started mis-generating this stuff, ugh. --dkg --=-=-= Content-Type: application/zip Content-Disposition: attachment; filename=attached-message-b64-encoded.zip Content-Transfer-Encoding: base64 UEsDBBQAAAAIAP24IlIRhV91yAIAACsEAAAgABwAYXR0YWNoZWQtbWVzc2FnZS1iNjQtZW5jb2Rl ZC5lbWxVVAkAAx5D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1lbmNvZGVkLmVtbFVUBQADHkPxX3V4CwABBOgDAAAE6AMAAFBLBQYAAAAA AQABAGYAAAAiAwAAAAA= --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYIAB0WIQQsv6x2UaqQJzY+dXHEDyVUMvKBDwUCX/FXNQAKCRDEDyVUMvKB D8KQAQDf5WoK7bMSNiIOLWqrBJ85U6cmrxGuMAvnQe+NiNV7zgD/aPSIKAKrvlRa BA6OozKWof3/MSOC7dceJFfFJaMEzwQ= =MIW5 -----END PGP SIGNATURE----- --==-=-=-- --===============2316951946874115296== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============2316951946874115296==--