X-Git-Url: http://git.ieval.ro/?p=app-edwardng.git;a=blobdiff_plain;f=lib%2FApp%2FEdwardNG.pm;fp=lib%2FApp%2FEdwardNG.pm;h=08b50eb827865e4b1e155cf2cee6f414dd605703;hp=256cf7d670d7031697918d079edeca7cc0805f8c;hb=70f9c37db1acb0579cf25d611468ddbb338c2efa;hpb=c3455a5beb4477f0080809fa474bc8e29b624956 diff --git a/lib/App/EdwardNG.pm b/lib/App/EdwardNG.pm index 256cf7d..08b50eb 100644 --- a/lib/App/EdwardNG.pm +++ b/lib/App/EdwardNG.pm @@ -129,9 +129,11 @@ sub run { Subject => 'Re: ' . $in->get('Subject'), Data => $data); + my $email_unencrypted = $email->dup; my $mg = mg always_trust => 1; - $mg->mime_signencrypt($email, $in->get('From') =~ /<(.*)>/) and debug 'Could not encrypt message. GnuPG said ', stringify $mg->{last_message}; - sendmail $email + my $encrypt_failed = $mg->mime_signencrypt($email, $in->get('From') =~ /<(.*)>/); + debug 'Could not encrypt message, sending unencrypted. GnuPG said ', stringify $mg->{last_message} if $encrypt_failed; + sendmail $encrypt_failed ? $email_unencrypted : $email } 1;