Composing ask From: address and arbitrary keys in PGP
Ryan Smith
GTC at riseup.net
Thu Aug 1 04:35:08 UTC 2019
On 2019-07-27 09:42, Robert wrote:
> On 2019-07-26, 05:12, GTC at riseup.net wrote:
>> 1. When composing messages, mutt ask To: or recipient adress and Subject: and then go to editor. How to make mutt ask for From: or sender address only and then go to editor?
>> This is useful for people with multiple accounts or multiple identities in each email account if they set custom headers based on each email account or identity eg, From: address.
>
> As it has been suggested earlier, a common way to handle this is the
> reply-hook. I would like to elaborate on this a bit, since you mentioned
> custom headers per identity:
>
> I'm using a profiles.rc file as a dispatcher for all identities
> (reply-hooks and shortcuts to toggle between identities) and as a fix
> point to include from muttrc.
>
> Each identity is a separate rc file which is then source'd.
>
> An example identity could look like this in the profiles.rc:
>
> macro index <Esc>1 '<enter-command>source
> ~/.config/neomutt/profiles.d/1.rc<enter>'
> macro compose <Esc>1 '<enter-command>source
>
> ~/.config/neomutt/profiles.d/1.rc<enter><edit-from><kill-line>current-from<enter>'
> reply-hook '~C ^person at example.com$' 'source
> ~/.config/neomutt/profiles.d/1.rc'
>
> That'll enable the <Esc>1 shortcut in both index and compose to switch
> to profile 1. In compose it will also set the from accordingly (using a
> alias that's set inside the 1.rc).
>
> The 1.rc might look like this:
>
> source ~/.config/neomutt/profiles.d/clear.rc
>
> set from="person at example.com"
> set realname="Example Person"
> alias current-from person at example.com (Person)
> set pgp_sign_as = ...
> set crypt_autosign = ...
>
> set record = +sent-mail
> set postponed = +drafts
> set trash = +dustbin
>
> clear.rc is a generic "blank profile" that resets all values so make
> sure that profiles don't bleed into each other.
>
> And from then on you can just add all the values that you want to have
> set in this identity.
>
> As you can see, you can even set the folders for sent mail, postponed
> messages and the trash.
>
> Hope this helps!
> Robert
I tried your code in both mutt and neomutt, created that 1.rc file in
the relevant directory, and both of them gives me error
Error in .muttrc, ~/.config/neomutt/profiles.d/1.rc<enter>: unknown
command
Error in .muttrc,
~/.config/neomutt/profiles.d/1.rc<enter><edit-from><kill-line>current-from<enter>:
unknown command
Error in .muttrc, ~/.config/neomutt/profiles.d/1.rc: unknown command
for mutt I also created a 1.rc file in ~.mutt/profiles.d/1.rc, still
gives me the same errors.
Can you check your codes to see if you typed correctly or you may have
left something?
Ryan
More information about the Mutt-users
mailing list