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;