From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL autolearn=ham autolearn_force=no version=3.4.4 Received: from mx1.math.uh.edu (mx1.math.uh.edu [129.7.128.32]) by inbox.vuxu.org (Postfix) with ESMTP id 2FAC421BE9 for ; Mon, 2 Dec 2024 16:12:06 +0100 (CET) Received: from lists1.math.uh.edu ([129.7.128.208]) by mx1.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1tI85g-00000007Te3-2D7d for ml@inbox.vuxu.org; Mon, 02 Dec 2024 09:12:04 -0600 Received: from lists1.math.uh.edu ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.97.1) (envelope-from ) id 1tI85f-00000007SAS-1ots for ml@inbox.vuxu.org; Mon, 02 Dec 2024 09:11:59 -0600 Received: from mx2.math.uh.edu ([129.7.128.33]) by lists1.math.uh.edu with esmtp (Exim 4.97.1) (envelope-from ) id 1tI85d-00000007SAL-3lMi for ding@lists.math.uh.edu; Mon, 02 Dec 2024 09:11:57 -0600 Received: from quimby.gnus.org ([95.216.78.240]) by mx2.math.uh.edu with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.98) (envelope-from ) id 1tI85X-00000006P56-3F3m for ding@lists.math.uh.edu; Mon, 02 Dec 2024 09:11:57 -0600 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID :In-Reply-To:Date:References:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=b0JEdzTJ3XDZnjb3ZBb9mHBhE4WX7XmXMsAxDVpFhNM=; b=N8qjcafdieHeI8rfYpjXaBYfUF QPsBBO58FJgxjKwg7ODbZT2PbwDm1SqhP/eT05ONKB1Aa/KDAIYjVRnjlwa68zZEeDAEheKH+4fxt gK1hELqJw0VZtv7oOljuXyKbWiFke+FJhjpMmQmWiTSyRdagL+qlzTnkB2Kg/rBfqvxw=; Received: from dilbert.mork.no ([2a01:4f9:c010:a439::d]) by quimby.gnus.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tI85Q-0007p9-1i for ding@gnus.org; Mon, 02 Dec 2024 16:11:46 +0100 Authentication-Results: dilbert.mork.no; dkim=pass (1024-bit key; secure) header.d=mork.no header.i=@mork.no header.a=rsa-sha256 header.s=b header.b=QisiTsWG; dkim-atps=neutral Received: from canardo.dyn.mork.no ([IPv6:2a01:799:10de:2e00:0:0:0:1]) (authenticated bits=0) by dilbert.mork.no (8.18.1/8.18.1) with ESMTPSA id 4B2FBfbq548870 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK) for ; Mon, 2 Dec 2024 15:11:42 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1733152300; bh=b0JEdzTJ3XDZnjb3ZBb9mHBhE4WX7XmXMsAxDVpFhNM=; h=From:To:Subject:References:Date:Message-ID:From; b=QisiTsWGHaA86F3RMbzw1HD5kPxxxKcgmtxisuVCBM1838YTvUJLS4IqCTzuAZwkd /pc2zHY8U9ut7SGv5xiUeLoooZVlcYBrtJD4YU/bDmNAGppo5LsGeXd8llyst+e7lO T7OgEcr5HSOu365iq97PYkZ9JfAhFXOPsSvD2h2o= Received: from miraculix.mork.no ([IPv6:2a01:799:10de:2e0a:149a:2079:3a3a:3457]) (authenticated bits=0) by canardo.dyn.mork.no (8.18.1/8.18.1) with ESMTPSA id 4B2FBerq3321034 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK) for ; Mon, 2 Dec 2024 16:11:40 +0100 Received: (nullmailer pid 516764 invoked by uid 1000); Mon, 02 Dec 2024 15:11:40 -0000 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: ding@gnus.org Subject: Re: What's the best way to auto-sign some emails but not all? Organization: m References: <871pyuksd7.fsf@miraculix.mork.no> <87jzckmv6k.fsf@gmail.com> <87o71wikra.fsf@miraculix.mork.no> Date: Mon, 02 Dec 2024 16:11:40 +0100 In-Reply-To: <87o71wikra.fsf@miraculix.mork.no> (=?utf-8?Q?=22Bj=C3=B8rn?= Mork"'s message of "Sat, 30 Nov 2024 20:28:41 +0100") Message-ID: <874j3mdsr7.fsf@miraculix.mork.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: clamav-milter 1.0.7 at canardo.mork.no X-Virus-Status: Clean List-ID: Precedence: bulk Thanks for all the great ideas. I have realized that there are probably more ways to do this than there are Gnus users :-) The discussion made me look closer at the code in question, which I should have done in the first place. And I believe my problem is that there are no hooks in the appropriate places. Yanking the original message happens very late, long after message-setup is finished. Most of the suggestions depend on message-setup-hook in some way, making them work and fail similar to my existing gnus-posting-styles setup. One exception is gnus-alias which AFAIU can apply a new identity to an existing message buffer. But that's an interactive choice, which is what I'm trying to avoid. After all, I could just run mml-secure-message-sign if I wanted to. So what I have ended up with is this ugly hack: #+BEGIN_SRC emacs-lisp (defun bjorn/message--yank-original-advice (arg) "Leave sign/encrypt mml tags untouched when yanking original" (when (looking-at "<#secure") (forward-line 1))) (advice-add 'message--yank-original-internal :before #'bjorn/message--yank-= original-advice) #+END_SRC which does the job for me when combined (body "<#secure method=3Dpgpmime mode=3Dsign>") in the appropriate posting style(s). Bj=C3=B8rn