Created
November 23, 2013 20:50
-
-
Save guns/7619783 to your computer and use it in GitHub Desktop.
Encrypt mail only to recipients with public keys
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Encrypt mail only to recipients with public keys | |
set my_cryptlist=`gpg --list-keys | ruby -e '\ | |
puts $stdin.read.scan(/<(.*?)>/)\ | |
.map { |(e)| "\\\\\\\\<%s\\\\\\\\>" % Regexp.escape(Regexp.escape(Regexp.escape(e))) }\ | |
.join("\\\\|")'` | |
send-hook ~A "set crypt_autoencrypt=no" | |
send-hook "~t ($my_cryptlist)" "set crypt_autoencrypt=yes" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment