[Rt-commit] r7661 - in rt/branches/3.7-EXPERIMENTAL: .

ruz at bestpractical.com ruz at bestpractical.com
Tue Apr 24 02:37:12 EDT 2007


Author: ruz
Date: Tue Apr 24 02:37:11 2007
New Revision: 7661

Modified:
   rt/branches/3.7-EXPERIMENTAL/   (props changed)
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm

Log:
 r5110 at cubic-pc:  cubic | 2007-04-24 10:33:08 +0400
 * add debug logging


Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Crypt/GnuPG.pm	Tue Apr 24 02:37:11 2007
@@ -467,8 +467,10 @@
         my $io = $entity->open('r');
         while ( defined($_ = $io->getline) ) {
             next unless /-----BEGIN PGP (SIGNED )?MESSAGE-----/;
+            my $type = $1? 'signed': 'encrypted';
+            $RT::Logger->debug("Found $type inline part");
             return {
-                Type   => ( $1? 'signed': 'encrypted' ),
+                Type   => $type,
                 Format => 'Inline',
                 Data   => $entity,
             };
@@ -495,6 +497,7 @@
                 $RT::Logger->info( "Skipping protocol '$protocol', only 'application/pgp-encrypted' is supported" );
                 return ();
             }
+            $RT::Logger->debug("Found encrypted according to RFC3156 part");
             return {
                 Type   => 'encrypted',
                 Format => 'RFC3156',
@@ -507,6 +510,7 @@
                 $RT::Logger->info( "Skipping protocol '$protocol', only 'application/pgp-signature' is supported" );
                 return ();
             }
+            $RT::Logger->debug("Found signed according to RFC3156 part");
             return {
                 Type      => 'signed',
                 Format    => 'RFC3156',
@@ -538,6 +542,7 @@
         }
 
         $skip{"$data_part"}++;
+        $RT::Logger->debug("Found signature in attachment '$sig_name' of attachment '$file_name'");
         push @res, {
             Type      => 'signed',
             Format    => 'Attachment',
@@ -555,6 +560,7 @@
 
     foreach my $part ( @encrypted_files ) {
         $skip{"$part"}++;
+        $RT::Logger->debug("Found encrypted attachment '". $part->head->recommended_filename ."'");
         push @res, {
             Type      => 'encrypted',
             Format    => 'Attachment',


More information about the Rt-commit mailing list