From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 4K80E9BEKmNCbwAAbAwnHQ (envelope-from ) for ; Wed, 21 Sep 2022 00:55:12 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 4Ij8EtBEKmNK5AAAauVa8A (envelope-from ) for ; Wed, 21 Sep 2022 00:55:12 +0200 Received: from mail.notmuchmail.org (yantan.tethera.net [135.181.149.255]) (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 088EA2A92D for ; Wed, 21 Sep 2022 00:55:12 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id D92545F366; Tue, 20 Sep 2022 22:49:03 +0000 (UTC) Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by mail.notmuchmail.org (Postfix) with ESMTPS id EA78B5E53B for ; Tue, 20 Sep 2022 20:44:45 +0000 (UTC) Received: by mail-wr1-x42b.google.com with SMTP id g3so6436632wrq.13 for ; Tue, 20 Sep 2022 13:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date; bh=BWReCEphmRzeGYcZ6+5V/Vu1vcKj3q9WRBnCBGtbjmg=; b=MUv6APYnlmlijdQvUccugW05Xetdlj9R5NBCycq8R1zg/gXxGyAtLABUQCAxlDYk7t /tPzYiEI8xKTYkU47loOCxRv+85f5iEkZ6WhUrnmJUBlhw0P3Jg8jrytaS2qSAzy8rAU JFs0VE+mNBdlhbxcFazz8fTtouKazwLEVP4cgDsVzJQgYsRriE3aS2ZocT9dyXUj1tKD TOAjX0Qed8fP0gV6h7f0pjwW9oXQTjhjYcNKlqWitzwng5HpKlAQQB6UfZdldqKuNq9G T+VuMvEsCLICR2urr874d7ygUmgSp2k7p0k8fvtn7JMU4McDVHoA5y8XLbo+f+omUUC0 NVyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date; bh=BWReCEphmRzeGYcZ6+5V/Vu1vcKj3q9WRBnCBGtbjmg=; b=ewwKLudydQBUmmUy96prsipGQwLYvCaC7j5cW5dtshTmg1GxKIX/SyjAsUR1J9wI+j 6VlYeRcOQNwT2QaIXQSKMBhVhT89Ok5fBMib2z+paoj15hM8i7Fp7mvqICH9d82xz1l8 DRhH1i3hHDKCsW0vRg7BTYDUUoVd9k+VKr+K/QsnPh6Z0119GzWrmBMLo76+779z2IJ8 mS49Hvds87p1p1KJtTk0vBrqJ7TkgwXij97cXDDS+J+i0YQZVm1krHjuOfQYwTp3t1db EWbc9JSEV1p83Fv2A+oM3CQRv8cIvzc6Qs9EVGsMTpJ2gKNgyeTm3LQprnCUPMMF4GwS 2UpA== X-Gm-Message-State: ACrzQf17y/0FX42LEW2DnLx+unjsLdLYqhzBHCt9eReorNtN452eqtkX zyh0krjPNFa8Lz+JLc4tXMYJ/ZVTdcU= X-Google-Smtp-Source: AMsMyM4SM2IL3Ht5STUcRS+AWagcT72kH1Du7lWZyt+nJdY+1n7JsGaGf88cljIy6jJMs1+2g6a8hQ== X-Received: by 2002:a05:6000:14c:b0:22a:c14a:29f8 with SMTP id r12-20020a056000014c00b0022ac14a29f8mr15138267wrx.588.1663706685117; Tue, 20 Sep 2022 13:44:45 -0700 (PDT) Received: from mowgli ([89.150.139.88]) by smtp.gmail.com with ESMTPSA id bv4-20020a0560001f0400b00228d6bc8450sm71033wrb.108.2022.09.20.13.44.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Sep 2022 13:44:44 -0700 (PDT) From: Russell Sim To: notmuch@notmuchmail.org Subject: [PATCH] emacs: move From header addition to after header intern Date: Tue, 20 Sep 2022 22:18:03 +0200 Message-Id: <87a1523f43d8c0227ba57065604feeeba1b676cf.1663706552.git.russell.sim@gmail.com> MIME-Version: 1.0 X-MailFrom: russell.sim@gmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 Message-ID-Hash: TJJI5DYSUHXKW7Y77AJT2T73KKIJZER7 X-Message-ID-Hash: TJJI5DYSUHXKW7Y77AJT2T73KKIJZER7 X-Mailman-Approved-At: Tue, 20 Sep 2022 22:49:01 +0000 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-To: larch@yhetil.org X-Migadu-Country: DE ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1663714512; 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=+Hgs7Q5+LgNZqB+YaJfNeirWzNH/ZZO8poPReRwX9lo=; b=SZjKAxju7BjZ8LTirNSMJrhCo4H5DI0jYX2jp56u8PuuH27F/qGwHoYfcvrTB6zRd+Z3tk Nob/njKoVAzmO11AtO8UfMKM6yNSGAsYVJ9DqzNWEGXRShS6mcuaSimCcfwnN3oKKsWtcD 7yKvN5XjLS2p2LCQPgamhYhIGGNXOvyPgPY16cTB8y+xLnnoMUrP/HdYdwo8uW0yG6kUH5 4d15CjDAP4H+5qI5Lo5Cp9a/mdEPVsrV+K/b6sRP6ClEOsuMhT667VTpBmU3t+8Rjz5qRG kQZm7811VskEwDzHy+jyyNR9Ivb8Fv3mtqZkJtqCpcioaKmspbQw8i0eVc2kgA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1663714512; a=rsa-sha256; cv=none; b=nwytkgeIPxw3guhjQRVeliLPXVW/ewf3JKiwI9FrqjVk5HiCVx5ufFOp1dctXsdfLDx68Z PlT1O+xP8yqo0HFT4NrJwTBrwfYBZkCP9pGQMKVtm1ouc1QPxnNgxYqjKJHzyLPsvdbukA 7zaQO7gt2VkYROW5vQX38w2JFXVZNm/ejiTFI/N3Nj+F/gq9AiuPDkTQOqCMO01jEsFL1a frS9WB74/lUDMw3EE9PGbarlbS7gIU0/Dzl6oWpet+JjmSw6lvFRAV++eNTM3/kfCzo5jO bOUgGws7o9U4i70V4T/9+myVRf7G/MHVV1edWy1oU+C1DVMeOwpwHjW1vbJvMQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=MUv6APYn; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: 6.88 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=gmail.com header.s=20210112 header.b=MUv6APYn; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 135.181.149.255 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 088EA2A92D X-Spam-Score: 6.88 X-Migadu-Scanner: scn1.migadu.com X-TUID: aAhkUT1LHYl6 OTHER-HEADERS are expected to be passed as strings, to match the implementation of `compose-mail'. But the "From" header is currently expected to be passed as a symbol. Instead the "From" header can be safely added after converting all the headers to symbols. --- emacs/notmuch-mua.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index ac878a61..3679d7d7 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -416,11 +416,6 @@ moved to the \"To:\" header." (let ((user-agent (funcall notmuch-mua-user-agent-function))) (unless (string-empty-p user-agent) (push (cons 'User-Agent user-agent) other-headers)))) - (unless (assq 'From other-headers) - (push (cons 'From (message-make-from - (notmuch-user-name) - (notmuch-user-primary-email))) - other-headers)) (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to) (or switch-function (notmuch-mua-get-switch-function))) @@ -439,6 +434,11 @@ moved to the \"To:\" header." ;; Cause `message-setup-1' to do things relevant for mail, ;; such as observe `message-default-mail-headers'. (message-this-is-mail t)) + (unless (assq 'From headers) + (push (cons 'From (message-make-from + (notmuch-user-name) + (notmuch-user-primary-email))) + headers)) (message-setup-1 headers yank-action send-actions return-action)) (notmuch-fcc-header-setup) (notmuch-mua--remove-dont-reply-to-names) -- 2.37.2