[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: using send-hook in mutt



Martin F. Krafft wrote:
> hi all,
> has anyone managed to configure mutt to GPG sign a message based on
> the recipient? using the line
> 
>   send-hook '~C debian.*' "set pgp_autosign"
> 
> i can get mutt to do it when i start it as 'mutt debian' (debian is an
> entry in my aliases file), but not when i simply enter 'debian' in the
> to line of the email as i compose it (with headers) in vi. the alias
> is expanded as soon as i close the message, getting ready to press 'y'
> in mutt to send it.
> 
> any ideas?

Depending on what address I send mail to, I have the need to turn GPG
signing on and off, as well as a few other settings needing twiddled. 
Here's a few lines of my send-hooks:

send-hook .* 'set pgp_autosign=yes; set signature=~/.sigfile'
send-hook listserv@mitvma.mit.edu 'set pgp_autosign=no; unset signature'
send-hook majordomo@ 'set pgp_autosign=no; unset signature'
send-hook suzuki-gs-twin@micapeak.com 'set pgp_autosign=no'
send-hook camarilla 'set signature=~/.sigfile_cam'

The first line is my default setup.  Second and third lines are for sending
commands to list servers - don't want attachments or sig blocks confusing
the server's command interpreters.  Fourth line is a list that doesn't allow
attachments.  Last line is a list where I want a sig block other than my
usual one.

The reason I have the first line there is because without it after sending a
message that matched (for example) one of the server command addresses
(second and third lines) then any messages after that weren't being signed
nor did they have sig blocks.  So I put the first line in to match all
messages.

As for matching the addresses and such, I've not had any troubles with that
working.  I often use aliases that bear little to no resemblance to the
actual address.  But by doing my matching in the send-hook on the actual
address that the message is going to it works here just fine.
-- 
Mike Werner  KA8YSD   | He that is slow to believe anything and
                      | everything is of great understanding,
'91 GS500E            | for belief in one false principle is the
Morgantown WV         | beginning of all unwisdom.

Attachment: pgpGvGqtMzHez.pgp
Description: PGP signature


Reply to: