]> git.uio.no Git - usit-rt.git/blobdiff - lib/RT/Interface/Email/Auth/Crypt.pm
Master to 4.2.8
[usit-rt.git] / lib / RT / Interface / Email / Auth / Crypt.pm
index 2703af973af85fca2d234477c65fa7018bd2b600..17df0d76fa79845ad1fa53fd7e8b3a2e182b6c20 100644 (file)
@@ -66,6 +66,9 @@ it put the module in the mail plugins list:
 
     Set(@MailPlugins, 'Auth::MailFrom', 'Auth::Crypt', ...other filters...);
 
+C<Auth::Crypt> will not function without C<Auth::MailFrom> listed before
+it.
+
 =head3 GnuPG
 
 To use the gnupg-secured mail gateway, you need to do the following:
@@ -172,7 +175,7 @@ sub GetCurrentUser {
 
         foreach my $protocol ( @check_protocols ) {
             my @status = grep defined && length,
-                $part->head->get( "X-RT-$protocol-Status" );
+                map Encode::decode( "UTF-8", $_), $part->head->get( "X-RT-$protocol-Status" );
             next unless @status;
 
             push @found, $protocol;
@@ -183,20 +186,20 @@ sub GetCurrentUser {
                 }
                 if ( $_->{Operation} eq 'Verify' && $_->{Status} eq 'DONE' ) {
                     $part->head->replace(
-                        'X-RT-Incoming-Signature' => $_->{UserString}
+                        'X-RT-Incoming-Signature' => Encode::encode( "UTF-8", $_->{UserString} )
                     );
                 }
             }
         }
 
         $part->head->replace(
-            'X-RT-Incoming-Encryption' => 
+            'X-RT-Incoming-Encryption' =>
                 $decrypted ? 'Success' : 'Not encrypted'
         );
     }
 
     my %seen;
-    $args{'Message'}->head->replace( 'X-RT-Privacy' => $_ )
+    $args{'Message'}->head->replace( 'X-RT-Privacy' => Encode::encode( "UTF-8", $_ ) )
         foreach grep !$seen{$_}++, @found;
 
     return 1;