[Rt-commit] r10794 - rt/branches/3.7-RTIR-RELENG/lib/RT/Crypt

ruz at bestpractical.com ruz at bestpractical.com
Sun Feb 10 11:58:38 EST 2008


Author: ruz
Date: Sun Feb 10 11:58:38 2008
New Revision: 10794

Modified:
   rt/branches/3.7-RTIR-RELENG/lib/RT/Crypt/GnuPG.pm

Log:
* we should use 7bit encodings when send signed only content

Modified: rt/branches/3.7-RTIR-RELENG/lib/RT/Crypt/GnuPG.pm
==============================================================================
--- rt/branches/3.7-RTIR-RELENG/lib/RT/Crypt/GnuPG.pm	(original)
+++ rt/branches/3.7-RTIR-RELENG/lib/RT/Crypt/GnuPG.pm	Sun Feb 10 11:58:38 2008
@@ -478,7 +478,14 @@
     my %res;
     if ( $args{'Sign'} && !$args{'Encrypt'} ) {
         # required by RFC3156(Ch. 5) and RFC1847(Ch. 2.1)
-        $entity->head->mime_attr('Content-Transfer-Encoding' => 'quoted-printable');
+        foreach ( grep !$_->is_multipart, $entity->parts_DFS ) {
+            my $tenc = $_->head->mime_encoding;
+            unless ( $tenc =~ m/^(?:7bit|quoted-printable|base64)$/i ) {
+                $_->head->mime_attr( 'Content-Transfer-Encoding'
+                    => $_->effective_type =~ m{^text/}? 'quoted-printable': 'base64'
+                );
+            }
+        }
 
         my %handle;
         my $handles = GnuPG::Handles->new(


More information about the Rt-commit mailing list