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

ruz at bestpractical.com ruz at bestpractical.com
Tue Jan 9 15:56:17 EST 2007


Author: ruz
Date: Tue Jan  9 15:56:15 2007
New Revision: 6727

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

Log:
 r4332 at cubic-pc:  cubic | 2007-01-09 22:21:31 +0300
 * prepare parser in RT::EmailParser
 * create temporary files in File::Spec::tmpdir


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 Jan  9 15:56:15 2007
@@ -5,6 +5,7 @@
 
 use IO::Handle;
 use GnuPG::Interface;
+use RT::EmailParser ();
 
 # gnupg options supported by GnuPG::Interface
 # other otions should be handled via extra args params
@@ -121,7 +122,7 @@
             map Mail::Address->parse( $entity->head->get( $_ ) ),
             qw(To Cc Bcc);
 
-        my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( DIR => '/tmp' );
+        my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
         binmode $tmp_fh, ':raw';
 
         my %handle;
@@ -376,7 +377,7 @@
         meta_interactive => 0,
     );
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( DIR => '/tmp' );
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
     binmode $tmp_fh, ':raw';
     $args{'Data'}->bodyhandle->print( $tmp_fh );
     $tmp_fh->flush;
@@ -427,7 +428,7 @@
         meta_interactive => 0,
     );
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( DIR => '/tmp' );
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
     binmode $tmp_fh, ':raw:eol(CRLF?)';
     $args{'Data'}->print( $tmp_fh );
     $tmp_fh->flush;
@@ -478,7 +479,7 @@
         meta_interactive => 0,
     );
 
-    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile( DIR => '/tmp' );
+    my ($tmp_fh, $tmp_fn) = File::Temp::tempfile();
     binmode $tmp_fh, ':raw';
 
     my %handle;
@@ -519,8 +520,8 @@
 
     seek $tmp_fh, 0, 0;
     my $parser = new MIME::Parser;
+    RT::EmailParser->_SetupMIMEParser( $parser );
     my $decrypted = $parser->parse( $tmp_fh );
-
     $args{'Top'}->parts( [] );
     $args{'Top'}->add_part( $decrypted );
     $args{'Top'}->make_singlepart;


More information about the Rt-commit mailing list