[Rt-commit] r8581 - in rt/branches/3.7-EXPERIMENTAL-TUNIS: lib/RT/Interface/Email/Auth

sartak at bestpractical.com sartak at bestpractical.com
Thu Aug 16 15:00:57 EDT 2007


Author: sartak
Date: Thu Aug 16 15:00:57 2007
New Revision: 8581

Modified:
   rt/branches/3.7-EXPERIMENTAL-TUNIS/   (props changed)
   rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Email/Auth/GnuPG.pm

Log:
 r30365 at caladan:  sartak | 2007-08-16 15:00:28 -0400
 Set headers on the right message


Modified: rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Email/Auth/GnuPG.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Email/Auth/GnuPG.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL-TUNIS/lib/RT/Interface/Email/Auth/GnuPG.pm	Thu Aug 16 15:00:57 2007
@@ -78,7 +78,7 @@
         for qw(X-RT-GnuPG-Status X-RT-Incoming-Encrypton
                X-RT-Incoming-Signature X-RT-Privacy);
 
-    my $decoded = $args{'Message'};
+    my $msg = $args{'Message'}->dup;
 
     # GPG needs an exact copy of the message to properly verify signatures
     # whitespace changes introduced by decoding and re-encoding means we're 
@@ -89,9 +89,9 @@
         Decode => 0,
         Exact => 1,
     );
-    $args{'Message'} = $parser->Entity();
+    my $raw_msg = $parser->Entity();
 
-    my ($status, @res) = VerifyDecrypt( Entity => $args{'Message'} );
+    my ($status, @res) = VerifyDecrypt( Entity => $raw_msg );
     if ( $status && !@res ) {
         $args{'Message'}->head->add(
             'X-RT-Incoming-Encryption' => 'Not encrypted'
@@ -105,7 +105,7 @@
 
     unless ( $status ) {
         $RT::Logger->error("Had a problem during decrypting and verifying");
-        my $reject = HandleErrors( Message => $args{'Message'}, Result => \@res );
+        my $reject = HandleErrors( Message => $raw_msg, Result => \@res );
         return (-2, 'rejected because of problems during decrypting and verifying')
             if $reject;
     }
@@ -114,7 +114,7 @@
     $args{'Message'}->attach(
         Type        => 'application/x-rt-original-message',
         Disposition => 'inline',
-        Data        => $decoded->as_string,
+        Data        => $msg->as_string,
     );
 
     $args{'Message'}->head->add( 'X-RT-GnuPG-Status' => $_->{'status'} )


More information about the Rt-commit mailing list