From 2044b38a0328a71f923cbe1e55f0d95254f3fff4 Mon Sep 17 00:00:00 2001 From: Marius Gavrilescu Date: Tue, 8 Jul 2014 00:13:06 +0300 Subject: [PATCH] Add more debugging information --- lib/App/EdwardNG.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/App/EdwardNG.pm b/lib/App/EdwardNG.pm index 6f6b3a0..e778d6a 100644 --- a/lib/App/EdwardNG.pm +++ b/lib/App/EdwardNG.pm @@ -105,6 +105,7 @@ sub run { $parser->decode_bodies(0); $parser->output_to_core(1); my $in = $parser->parse(\*STDIN); + debug 'Received mail from ', $in->get('From'); my ($tmpl, %params); try { @@ -112,6 +113,7 @@ sub run { } catch { ($tmpl, %params) = (error => message => $_) }; + debug "Result is $tmpl, GnuPG said:\n", $params{message}; $params{plaintext} = first_part $params{decrypted} if $params{decrypted}; @@ -127,7 +129,7 @@ sub run { my $email_unencrypted = $email->dup; my $mg = mg always_trust => 1; 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; + debug 'Could not encrypt message, sending unencrypted. GnuPG said:', "\n", stringify $mg->{last_message} if $encrypt_failed; sendmail $encrypt_failed ? $email_unencrypted : $email } -- 2.30.2