From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id KBQiGtdW6WGQkwAAgWs5BA (envelope-from ) for ; Thu, 20 Jan 2022 13:34:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id UAp6F9dW6WFzTQAA9RJhRA (envelope-from ) for ; Thu, 20 Jan 2022 13:34:31 +0100 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)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id E470A2DD28 for ; Thu, 20 Jan 2022 13:34:30 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 6DFAC5F71D; Thu, 20 Jan 2022 12:34:11 +0000 (UTC) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by mail.notmuchmail.org (Postfix) with ESMTP id E9C6C5F700 for ; Thu, 20 Jan 2022 12:34:08 +0000 (UTC) Received: by fethera.tethera.net (Postfix, from userid 1001) id 1BB6F5FC01; Thu, 20 Jan 2022 07:34:07 -0500 (EST) Received: (nullmailer pid 4003278 invoked by uid 1000); Thu, 20 Jan 2022 12:34:02 -0000 From: David Bremner To: notmuch@notmuchmail.org Subject: [PATCH 4/4] emacs: use cached encoded copy for fcc Date: Thu, 20 Jan 2022 08:33:54 -0400 Message-Id: <20220120123354.3999579-5-david@tethera.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220120123354.3999579-1-david@tethera.net> References: <20220120123354.3999579-1-david@tethera.net> MIME-Version: 1.0 Message-ID-Hash: UTN75YTYDHIQP4BRIVYI5JU3TO3A3XSW X-Message-ID-Hash: UTN75YTYDHIQP4BRIVYI5JU3TO3A3XSW X-MailFrom: bremner@tethera.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; 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1642682070; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post; bh=srKq/gCgW2tOi6bWiyCbl+R7FnFbbz48OHoiW7PrCq4=; b=PA9ROO93Rexp2vy+8JiIbI9Fs82mFfH4X1xeNmKHLLjRQSZF/Y7KzAYws/iuM/PPqB2NZQ eowkqTOamAnixoQQfGE4r1ulb46+2wOOZcRgOSPyWqGNDF8Kyh5tHTaZgWaq08Gr+GvP+R vQtcyaE+PgVP+aNI5ojCD/1hsqhKSa5oZE4C8SR6IH7j96y36cbbFecgXFyPFdyDHPieoX ryjBntdArOo8AFmWVuAVPoBq0r3JRWeqpNisrjlCQHzCZDGGgpYhqb2pBiDxkVjEQ7TxvW XojFDl0MA4D5lRzQRc56N6rHXEENKUKqVOg0qslJClBeby+AA5YoYu1ZtJDMQg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1642682070; a=rsa-sha256; cv=none; b=dj77HgaSNFUnjdY63ViXlS2TJX+wEzwlUspfCC6Do55D8tFiQ1NTLxevexV/e5pIxenxli d4Ex8sQO3rE8GF6c0P6ssqtIl7CiUfRxlvKqiXC9qvIQMExHIwOE18gNNqvpM/5HwYigh3 m3B6e/PdPcGPfaxvhMBhKm6jObiN3udwVD3UUGjrSXjI5UH8qcZMFc+rHQVNpAsJ0mWJRJ oAXBzjZwLCmiWCRgIRys2k8Du/deV8um765p56qBp6caA0CYR8kLgXw1c3DEAFJpNHUltv 6D+1bnWHaPB7CmvCBcrpHLAp7gghNGvS8muhN61/AXbv/09Oe/1SZ2Bn7tvnRA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=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 X-Migadu-Spam-Score: -1.32 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=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 X-Migadu-Queue-Id: E470A2DD28 X-Spam-Score: -1.32 X-Migadu-Scanner: scn1.migadu.com X-TUID: Wi5A+mtC83vl This fixes the bug reported by dkg in [1]. The movement of the call to n-m-setup-message-for-saving is so the cleanup of Fcc headers happens in the encoded version (otherwise Fcc headers may be saved to disk). [1]: id:87k1zm225v.fsf@fifthhorseman.net --- emacs/notmuch-maildir-fcc.el | 8 ++++++-- test/T350-crypto.sh | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch-maildir-fcc.el b/emacs/notmuch-maildir-fcc.el index 7e177bf7..51020788 100644 --- a/emacs/notmuch-maildir-fcc.el +++ b/emacs/notmuch-maildir-fcc.el @@ -149,6 +149,7 @@ Otherwise set it according to `notmuch-fcc-dirs'." (buf (current-buffer)) (mml-externalize-attachments message-fcc-externalize-attachments)) (with-current-buffer (get-buffer-create " *message temp*") + (message-clone-locals buf) ;; for message-encoded-mail-cache (erase-buffer) (insert-buffer-substring buf) ,@body))) @@ -158,7 +159,10 @@ Otherwise set it according to `notmuch-fcc-dirs'." This should be called on a temporary copy. This is taken from the function message-do-fcc." - (message-encode-message-body) + (if (not message-encoded-mail-cache) + (message-encode-message-body) + (erase-buffer) + (insert message-encoded-mail-cache)) (save-restriction (message-narrow-to-headers) (mail-encode-encoded-word-buffer)) @@ -179,12 +183,12 @@ This is a rearranged version of message mode's message-do-fcc." (setq file (message-fetch-field "fcc" t))) (when file (with-temporary-notmuch-message-buffer + (notmuch-maildir-setup-message-for-saving) (save-restriction (message-narrow-to-headers) (while (setq file (message-fetch-field "fcc" t)) (push file files) (message-remove-header "fcc" nil t))) - (notmuch-maildir-setup-message-for-saving) ;; Process FCC operations. (mapc #'notmuch-fcc-handler files) (kill-buffer (current-buffer))))))) diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh index 209b8a74..3c6626b4 100755 --- a/test/T350-crypto.sh +++ b/test/T350-crypto.sh @@ -21,7 +21,6 @@ test_expect_success \ "(mml-secure-message-sign)"' test_begin_subtest "emacs delivery of signed message via fcc and smtp" -test_subtest_known_broken emacs_deliver_message \ 'signed message sent via SMTP' \ 'This is a test that messages are sent via SMTP' \ -- 2.34.1