[neomutt-users] The From: section in composing new messages and the dynamic PGP key selection

DebXwoody stefan at debxwoody.de
Tue Aug 6 22:38:01 CEST 2019

Am Dienstag, den 06.08.2019 um 16:12:47 -0400 schrieb ajs at anvilwalrusden.com:
> Hi,
> On Tue, Aug 06, 2019 at 04:32:50PM +0000, GTC at riseup.net wrote:
> > 1. Does neomutt have the function that when composing messages, asking From: section?
> No, but you could set up a macro to set the From.  But I still suspect
> you want a send-hook or maybe a send2-hook combined perhaps with an
> account-hook and folder-hook.  That's how I do this, combined with a
> macro that allows me to set the From: address on new messages.  For instance:
> 	macro generic,pager,index,attach,compose,editor <F2> ":set from=ajs at anvilwalrusden.com<Enter>" "Mail from anvil"

Maybe edit_headers

# -------------------------------------------------------------------------
# Name: edit_headers
# -------------------------------------------------------------------------
# This option allows you to edit the header of your outgoing messages along
# with the body of your message.  Although  the  compose menu may have
# localized header labels, the labels passed to your editor will be
# standard RFC2822 headers, (e.g. To:, Cc:, Subject:).  Headers  added  in
# your editor must also be RFC2822 headers, or one of the pseudo headers
# listed in “edit- header”.  NeoMutt will not understand localized header
# labels, just  as  it  would  not when parsing an actual email.  Note
# that changes made to the References: and Date: headers are ignored for
# interoper‐ ability reasons.
# -------------------------------------------------------------------------

set edit_headers

> > 2. In PGP encrption also, neomutt seems to always use default key or oldest key as encrypt_self or From: encryption key. 
> > 
> > How to disable such bug and let user to choose  arbitrary key from system key ring as enrypt_to_self or From encrption key?
> > 
> It's not a bug, it's a binding between the From address and the key.
> If you want this not to happen, set $pgp_default_key or maybe
> $pgp_sign_as.  If you change accounts (as above) you can use the
> relevant hooks to set the variable depending on the email address.

I use the setup like this:

send2-hook . unset pgp_sign_as
send2-hook '~f @domain1.tld' set pgp_sign_as=0xABC
send2-hook '~f @domain2.tld' set pgp_sign_as=0x123


More information about the neomutt-users mailing list