Added action encrypt

tmp
cranix 2017-02-26 19:11:22 +01:00
parent b92ce33995
commit 398af5c4a8
1 changed files with 20 additions and 2 deletions

22
kuvert
View File

@ -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