[Rt-commit] r13459 - in rt/3.8/trunk: .

alexmv at bestpractical.com alexmv at bestpractical.com
Fri Jun 20 14:09:58 EDT 2008


Author: alexmv
Date: Fri Jun 20 14:09:56 2008
New Revision: 13459

Modified:
   rt/3.8/trunk/   (props changed)
   rt/3.8/trunk/lib/RT/Template_Overlay.pm

Log:
 r33305 at kohr-ah:  chmrr | 2008-06-20 14:09:47 -0400
  * Code reuse for MIME::Parser setup


Modified: rt/3.8/trunk/lib/RT/Template_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Template_Overlay.pm	(original)
+++ rt/3.8/trunk/lib/RT/Template_Overlay.pm	Fri Jun 20 14:09:56 2008
@@ -341,19 +341,13 @@
         $content = "\n".$content;
     }
 
-    #Lets build our mime Entity
-
+    # Re-use the MIMEParser setup code from RT::EmailParser, which
+    # tries to use tmpdirs, falling back to in-memory parsing. But we
+    # don't stick the RT::EmailParser into a lexical because it cleans
+    # out the tmpdir it makes on DESTROY
     my $parser = MIME::Parser->new();
-
-    # On some situations TMPDIR is non-writable. sad but true.
-    $parser->output_to_core(1);
-    $parser->tmp_to_core(1);
-
-    #If someone includes a message, don't extract it
-    $parser->extract_nested_messages(1);
-
-    # Set up the prefix for files with auto-generated names:
-    $parser->output_prefix("part");
+    $self->{rtparser} = RT::EmailParser->new;
+    $self->{rtparser}->_SetupMIMEParser($parser);
 
     ### Should we forgive normally-fatal errors?
     $parser->ignore_errors(1);


More information about the Rt-commit mailing list