From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms1.migadu.com with LMTPS id 4NvGMUulKGZDfQEAqHPOHw:P1 (envelope-from ) for ; Wed, 24 Apr 2024 08:23:07 +0200 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 4NvGMUulKGZDfQEAqHPOHw (envelope-from ) for ; Wed, 24 Apr 2024 08:23:07 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=NRfU0iwR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gnu.org (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1713939787; a=rsa-sha256; cv=none; b=KTzUafL9b3bFm6izaBzriHC8JCzgpaI+RqB1FuyUTfoBzycvIQvkl8NonZ1KbNew/D8oNX xH4wn1eWOPsAAtHLcYPGV0JRYSqUKt29+LmThm7t+F+tnZqYZb5pA9Eq6+dCJitTnlKKdJ VQWlZp+/nIO5AXxOXX7saL1bN6yUEDekje7sPZh94l5fXXvYwQomkGIDcbDDP7MBJuXCTq NwjX1v2VmgkxXpyYNeWAevMeR9213/mbXOvLxwVsQdjpL/ybZJdZIWgY5sia6zRRvMVQYg vQn4IiMs/7vFJNiOYnxaKJTl4n7eY9GDaLxcNRv2HjpSynMUXvJWfiZg+tIhxQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gnu.org header.s=fencepost-gnu-org header.b=NRfU0iwR; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gnu.org (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1713939787; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=PCeTfRjj6H+vkgtFmpGo6bmK0bzw6fOthrFi9FpdcIs=; b=lHDd7IGmBdjr9HmPdmlWHYXCSIb6znzC2YHrT8SeyhxPCGoTHrrPcJUqBx2oaIWs10r8QJ lEvPVDDLt1ZUH7RtN6WDiyUsrZQJM5zKAM2avZeVSgLtPQGqTj10QlN+qCB6t1LlILkBRW 9YyKgN9ZsdCzHBIZGU3x0BaGo/qlkaG4CifypASpI3AOLT11MtuuMxp5DxGUxW68buCwrW vGR8e8mwPoDF0u5rv/keLAm0nsne4UpkNzALVfsM1z4rp/n0BxHpAJ8/j88aRQ2hRuUMUp JMKfL1h/kmyzdEZQ9yfrLI53k7OPY00qquf+DYn1I6CUkGKx3ddjLK8KVQjrrA== Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 5CE3A77C25 for ; Wed, 24 Apr 2024 08:23:07 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 1CA3E5F7D1; Wed, 24 Apr 2024 06:22:59 +0000 (UTC) Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by mail.notmuchmail.org (Postfix) with ESMTPS id 61FDB5F7B7 for ; Wed, 24 Apr 2024 06:22:56 +0000 (UTC) Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rzW1u-0003nz-9z for notmuch@notmuchmail.org; Wed, 24 Apr 2024 02:22:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=+8A8dZY3Cg4pE5Q9TQKdiboEGASxi9SUoi+artMv6VM=; b=NRfU0iwRH4eOSj Q6nfcsaVWs2jLZQpkZv7bfZeawvfIQskSmETzM3Vo5fHsiLCGXSih9Jszn1INZ6hw5aLAuefE8uT6 k93BtD8NgopHi88DtB5pm80eZQhKazXR0Mj39tofMCC4iQfTIspLoORZy/TBCtk66xVnsBvoFtP0G zF+bZBx7KdyeM7oigVgCFgR1u/+MQSz7s6dPcf/rtujnQ8ohJXiC8GV4JRGMSOXPMWp9coVbryBd0 NCFIjpEnkuvp2fmlU4Y7M+2nPSoK/HYMoCvbwa3ygyGnE0rGRrr0aUGj1KyN+LmMIsH7NNbx5M0f4 LQBezZ/j0GEpI4WZFkOQ==; Message-ID: From: Herbert Valerio Riedel To: notmuch@notmuchmail.org Subject: `notmuch-message-headers` interpreted case-sensitively Date: Wed, 24 Apr 2024 08:22:41 +0200 MIME-Version: 1.0 Message-ID-Hash: ALEY5P55YYLFSDIAHNBUEXLT656KPHYT X-Message-ID-Hash: ALEY5P55YYLFSDIAHNBUEXLT656KPHYT X-MailFrom: hvr@gnu.org 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; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE X-Spam-Score: 0.89 X-Migadu-Queue-Id: 5CE3A77C25 X-Migadu-Spam-Score: 0.89 X-Migadu-Scanner: mx10.migadu.com X-TUID: nMbq6eDzI8Dx Hello! Not sure if this is a bug or intentional behaviour but it did surprise me: When I added "Message-Id" to `notmuch-message-headers` I noticed that sometimes the header would be shown and sometimes not. It turns out that some MUAs generate the header as "Message-Id" and others as "Message-ID" with a slightly different capitalization. Only when I included both, "Message-Id" and "Message-ID", in `notmuch-message-headers` I was able to workaround this issue. the culprit seems to be the function below which does no attempt to retrieve the respective header case-insensitively via `plist-get` as it constructs a symbol :Message-Id or :Message-id respectively which are not equal as the `eq` comparison is used by default: --8<---------------cut here---------------start------------->8--- (defun notmuch-show-insert-headers (headers) "Insert the headers of the current message." (let ((start (point))) (mapc (lambda (header) (let* ((header-symbol (intern (concat ":" header))) (header-value (plist-get headers header-symbol))) (when (and header-value (not (string-equal "" header-value))) (notmuch-show-insert-header header header-value)))) notmuch-message-headers) (save-excursion (save-restriction (narrow-to-region start (point-max)) (run-hooks 'notmuch-show-markup-headers-hook))))) --8<---------------cut here---------------end--------------->8---