On Thu, Jan 21, 2010 at 04:02:44AM +0100, E. Prom wrote: > Hi, > > [snip] > > An ugly way would be to write a script that reads the aliases files > and writes all the hook-lines. Dozens of hooks lines... I don't like > it.
Hi,
I've had a similar problem: I wanted to automatically encrypt all
mails where I have the GPG key. The only solution I could find,
was to write a little perl script which writes the hook-lines and
call it:
source ~/.mutt/crypto-autoencrypt.pl|
Here is it, in case somebody might find it useful.
open my $gpg, '-|', 'gpg --list-keys --with-colons --fixed-list-mode' or
die $!;
while (<$gpg>) {
next unless /<(....@.+?)>/;
print "send-hook '~t .*$1.*' 'set crypt_autoencrypt=yes'\n";
}
close $gpg;
I haven't found a better solution so AFAIK this is the only
solution. If anybody knows a better solution I really would like
to hear it.
Hope this helps,
Simon
--
+ privacy is necessary
+ using gnupg http://gnupg.org
+ public key id: 0x92FEFDB7E44C32F9
pgpYsKTWNyfWi.pgp
Description: PGP signature
