[Rt-commit] r18465 - rt/3.8/trunk/lib/RT/Interface/Email/Auth

ruz at bestpractical.com ruz at bestpractical.com
Thu Feb 19 01:45:25 EST 2009


Author: ruz
Date: Thu Feb 19 01:45:24 2009
New Revision: 18465

Modified:
   rt/3.8/trunk/lib/RT/Interface/Email/Auth/GnuPG.pm

Log:
* we have status on all parts

Modified: rt/3.8/trunk/lib/RT/Interface/Email/Auth/GnuPG.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Interface/Email/Auth/GnuPG.pm	(original)
+++ rt/3.8/trunk/lib/RT/Interface/Email/Auth/GnuPG.pm	Thu Feb 19 01:45:24 2009
@@ -107,28 +107,29 @@
         Data        => ${ $args{'RawMessageRef'} },
     );
 
-    $args{'Message'}->head->add( 'X-RT-GnuPG-Status' => $_->{'status'} )
-        foreach @res;
     $args{'Message'}->head->add( 'X-RT-Privacy' => 'PGP' );
 
-    # XXX: first entity only for now
-    if (@res) {
+    foreach my $part ( $args{'Message'}->parts_DFS ) {
         my $decrypted;
-        my @status = RT::Crypt::GnuPG::ParseStatus( $res[0]->{'status'} );
-        for (@status) {
-            if ( $_->{Operation} eq 'Decrypt' && $_->{Status} eq 'DONE' ) {
-                $decrypted = 1;
-            }
-            if ( $_->{Operation} eq 'Verify' && $_->{Status} eq 'DONE' ) {
-                $args{'Message'}->head->add(
-                    'X-RT-Incoming-Signature' => $_->{UserString}
-                );
+
+        my $status = $part->head->get( 'X-RT-GnuPG-Status' );
+        if ( $status ) {
+            for ( RT::Crypt::GnuPG::ParseStatus( $status ) ) {
+                if ( $_->{Operation} eq 'Decrypt' && $_->{Status} eq 'DONE' ) {
+                    $decrypted = 1;
+                }
+                if ( $_->{Operation} eq 'Verify' && $_->{Status} eq 'DONE' ) {
+                    $part->head->add(
+                        'X-RT-Incoming-Signature' => $_->{UserString}
+                    );
+                }
             }
         }
 
-        $args{'Message'}->head->add( 'X-RT-Incoming-Encryption' => $decrypted
-            ? 'Success'
-            : 'Not encrypted' );
+        $part->head->add(
+            'X-RT-Incoming-Encryption' => 
+                $decrypted ? 'Success' : 'Not encrypted'
+        );
     }
 
     return 1;


More information about the Rt-commit mailing list