summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcranix <cranix@hackerspace.pl>2017-02-26 19:11:22 +0100
committercranix <cranix@hackerspace.pl>2017-02-26 19:11:22 +0100
commit398af5c4a88cbc57c7ab1663ba903ea95e39a209 (patch)
tree4d6d424249fad86f0d76b1387f53c0687bfa028e
parentb92ce339958b2bc08d58c17537867c2eaa74c36e (diff)
downloadkuvert-tmp.tar.gz
kuvert-tmp.tar.bz2
kuvert-tmp.tar.xz
kuvert-tmp.zip
Added action encrypttmp
-rwxr-xr-xkuvert22
1 files changed, 20 insertions, 2 deletions
diff --git a/kuvert b/kuvert
index 321f89e..fc62934 100755
--- a/kuvert
+++ b/kuvert
@@ -515,6 +515,13 @@ sub process_file
return @res if (@res);
}
+ #Check if mail needs to be dropped due to
+ #encrypt option being specyfied and lack of key
+ if (grep($_ eq "drop",values(%actions)))
+ {
+ return "Dropping mail due to lack of encryption key. Mail would be sent to: @rawrecips";
+ }
+
my ($orig_header,$cryptoin);
# prepare various stuff we need only when encrypting or signing
if(grep($_ ne "none",values(%actions)))
@@ -628,7 +635,7 @@ sub findaction
}
# next: check individual action=x directives
- if ($a->[4] =~/action=(none|fallback-all|fallback|signonly)/)
+ if ($a->[4] =~/action=(none|fallback-all|fallback|signonly|encrypt)/)
{
my $thisaction=$1;
$actions{$addr}=$thisaction;
@@ -640,7 +647,13 @@ sub findaction
$specialkeys{$addr}=$1;
dlogit("local key override: $specialkeys{$addr} for $addr");
}
-
+
+ #Encrypt or drop everything
+ if ($actions{$addr}=~/^encrypt/)
+ {
+ $actions{$addr}=$specialkeys{$addr}||$email2key{$addr}||"drop";
+ }
+
# now test for key existence and downgrade action to signonly
# where necessary.
if ($actions{$addr}=~/^fallback/)
@@ -1738,6 +1751,11 @@ of this email are sent out: if we can we use encryption for everybody, or
otherwise everybody gets it signed (or even unsigned).
(Bcc'd recipients are the exception.)
+=item encrypt
+
+Encrypts and signs mail if key is found for given recipent.
+If no key is found mail is dropped
+
=back
=head2 Specifying Actions