On 30Jun2015 16:47, Jon LaBadie <mut...@jgcomp.com> wrote:
On Tue, Jun 30, 2015 at 10:11:53PM +0200, jonas hedman wrote:
On 15-06-30 22:00:27, Niels Kobschaetzki wrote:
> is it possible to use with one account PGP and S/Mime? I found a how-to
> for using S/Mime or using mutt with one account with PGP and one account
> S/Mime. But I want to use my main account with both and would like to
> choose on a per user basis whether I encrypt via PGP or S/Mime. I know
> people who use only PGP and others only S/Mime.
> So: is this possible in mutt? If yes, how - any how-tos you can
> recommend?

I use send-hooks for this for examples
send-hook someonewhoperfersinlinecry...@mail.com "set pgp_autoinline; set 
pgp_autoencrypt"
While I have S/Mime as standard in my default crypto settings.

For configuration ease, so as not to have lots of send-hooks,
could you do something like:

set my_PersonsWhoUsePGP = "\
   pers...@email1.com,\
   pers...@email2.com,\
     ...
   pers...@emailn.com"

send-hook $my_PersonsWhoUsePGP "set pgp_autoinline; set pgp_autoencrypt"

A cleaner solution might be to reframe the above like this:

 alias -group pgpers pgpers pers...@email1.com, pers...@email2.com, ...

 send-hook '%C pgpers' 'set pgp_autoinline; set pgp_autoencrypt'

I suggest this for two reasons. First, address groups seem a much cleaner system for talking about groups of addresses and second, I use them aggressively! I keep a little maildb which assigns group names to addresses, and autogenerate mutt aliases formed like the above from it. Why the maildb? Because my mail filing also uses these groups in its rules.

As a real world example, I use this in my muttrc for HTML:

 message-hook . 'unalternative_order *; alternative_order text/plain text/html'
 # Apple Mail embeds attachments in the HTML part instead of outside the 
multipart/mixed
 message-hook '~h "X-Mailer: Apple Mail" ~X 1-' 'unalternative_order *; 
alternative_order text/html multipart/mixed text/plain'
 message-hook '%f htmlers | ~f @no-re...@cc.yahoo-inc.com | ~f @outlook.com | 
~f live.com | ~f @facebookmail.com' 'unalternative_order *; alternative_order 
text/html text/plain'

That final message-hook selects HTML in preference for messages from people in my "htmlers" mutt group.

Cheers,
Cameron Simpson <c...@zip.com.au>

When Microsoft Office is your only hammer, pretty much everything begins to
look like a nail. Or a thumb. - Rob Pegoraro

Reply via email to