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.1 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 1234321380 for ; Sat, 30 Nov 2024 20:29:08 +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 1tHT9J-00000005zZV-2azc for ml@inbox.vuxu.org; Sat, 30 Nov 2024 13:29:05 -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 1tHT9I-00000007OZm-0vrH for ml@inbox.vuxu.org; Sat, 30 Nov 2024 13:29:00 -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 1tHT9F-00000007OZd-1oPU for ding@lists.math.uh.edu; Sat, 30 Nov 2024 13:28: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 1tHT9A-00000004wkw-2osV for ding@lists.math.uh.edu; Sat, 30 Nov 2024 13:28: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:Cc:To:From:Sender:Reply-To: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=6yscZMThABSDw6RPxUg5H9J4eF3agl+LHGzxLOgCnWw=; b=iMXCydxQtB7REo55ZrngCSApGU Gr8KZN9Pr0dgrK9j6nKAsOs8tIMitM0XbkMbdOhVKa8P948KmUiqLovvlChl+YsU93c8QHCRShVI+ lAc1mlkJjPJ4Nh+kS6fM24OfO6uvsF5JpbSsHZrpWwPHK97A1jAp+U+2rZ/7HuSKAP7U=; 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 1tHT93-0007Za-L0 for ding@gnus.org; Sat, 30 Nov 2024 20:28:47 +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=NTWs9b8t; 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 4AUJSfiW419547 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Sat, 30 Nov 2024 19:28:43 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mork.no; s=b; t=1732994921; bh=6yscZMThABSDw6RPxUg5H9J4eF3agl+LHGzxLOgCnWw=; h=From:To:Cc:Subject:References:Date:Message-ID:From; b=NTWs9b8tUUHTSOrv+gu01j9usGyAMKWCZD4rQtsq8oIsIq9Jz8GAd+mzJwa7wL9zT v9JTuJ5Tfq9ji7LCgJoIK/8y/u2wSbimaukLaT/6aEY4xqfr6WQuqAARmSaggn/VcQ LYyFtNefmkWzAC7w8ZhqksR+6wKjbBZYKIP4ockc= 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 4AUJSf3p2932955 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=OK); Sat, 30 Nov 2024 20:28:41 +0100 Received: (nullmailer pid 415472 invoked by uid 1000); Sat, 30 Nov 2024 19:28:41 -0000 From: =?utf-8?Q?Bj=C3=B8rn_Mork?= To: Trevor Arjeski Cc: 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> Date: Sat, 30 Nov 2024 20:28:41 +0100 In-Reply-To: <87jzckmv6k.fsf@gmail.com> (Trevor Arjeski's message of "Sat, 30 Nov 2024 21:29:55 +0300") Message-ID: <87o71wikra.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 Trevor Arjeski writes: > Bj=C3=B8rn Mork writes: > >> Is there a nice way to always sign emails based on e.g. the current From >> address? I don't want to sign everything, but I would like to sign all >> emails I send from one specific address. > > Hi Bj=C3=B8rn, > > For me, I am signing all messages and just removing the "secure" tag > when I am writing on a mailing list or something. Yes, that's a possibilty. But do hate manual procedures for anything that can be automated. And knowing myself, I am going to forget this 47% of the time. I'll remember it if the passphrase box shows up. But I don't want to disable caching, and I am sure that will result in some emails going out with an unwanted gpg signature. Not a big problem, maybe. But we're looking for the perfect solution here :-) > I do this by adding a hook on `message-setup-hook' that calls > `mml-secure-message-encrypt'. > > Therefore, you can add a similar hook with the help of a function (or > just lambda), for example: > > #+BEGIN_SRC emacs-lisp > (defun my/mml-secure-message-encrypt () > "Encrypt all messages when we are sending as bjorn@mork.no. Do nothing > for all other From addresses." > (when (string=3D message-sendmail-envelope-from > "bjorn@mork.no") > (mml-secure-message-encrypt))) > > (add-hook 'message-setup-hook #'my/mml-secure-message-encrypt) > #+END_SRC > > Let me know if that is what you want or helps at all. Thanks a lot! It does not work any better, but at least it shows me how easy adding a hook would be. And it also made me look at how the gnus posting styles are implemented. I tried your suggestion with message-sendmail-envelope-from replaced by user-mail-address, since SPF prevents me from changing the envelope along with the from address. Unfortunately, this works exacly like using "body" or "eval" in a posting style. It's fine with an empty buffer, but not when replying with quoted text. Which isn't surprising after having looked at gnus-configure-posting-styles in gnus-msg.el. What gnus-configure-posting-styles does under the hood is (add-hook 'message-setup-hook (cond ((eq 'eval (car result)) #'ignore) ((eq 'body (car result)) (let ((txt (cdr result))) (lambda () (save-excursion (message-goto-body) (insert txt))))) etc. Not exactly sure how all this works, but it looks like the yanked text must be inserted into the buffer at a later stage. Bj=C3=B8rn