Gnus development mailing list
 help / color / mirror / Atom feed
From: Trevor Arjeski <tmarjeski@gmail.com>
To: "Bjørn Mork" <bjorn@mork.no>
Cc: ding@gnus.org
Subject: Re: What's the best way to auto-sign some emails but not all?
Date: Sat, 30 Nov 2024 21:29:55 +0300	[thread overview]
Message-ID: <87jzckmv6k.fsf@gmail.com> (raw)
In-Reply-To: <871pyuksd7.fsf@miraculix.mork.no> (=?utf-8?Q?=22Bj=C3=B8rn?= Mork"'s message of "Fri, 29 Nov 2024 15:49:08 +0100")

Bjørn Mork <bjorn@mork.no> 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ørn,

For me, I am signing all messages and just removing the "secure" tag
when I am writing on a mailing list or something.

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= 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.

Trevor


  reply	other threads:[~2024-12-02 18:38 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-29 14:49 Bjørn Mork
2024-11-30 18:29 ` Trevor Arjeski [this message]
2024-11-30 19:28   ` Bjørn Mork
2024-11-30 20:17     ` Trevor Arjeski
2024-12-02 15:11     ` Bjørn Mork
2024-12-03 10:35       ` Björn Bidar
2024-12-03 11:36         ` Bjørn Mork
2024-12-03 20:38           ` Björn Bidar
2024-12-01  3:58 ` Sean Whitton
2024-12-01 23:04 ` Björn Bidar
2024-12-01 23:43   ` Bob Newell
2024-12-08  5:05 ` James Thomas
2024-12-08 13:22   ` Bjørn Mork
2024-12-08 21:03     ` James Thomas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzckmv6k.fsf@gmail.com \
    --to=tmarjeski@gmail.com \
    --cc=bjorn@mork.no \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).