[Rt-commit] r2801 - in rt/branches/3.0-MAINT: . lib/RT
jesse at bestpractical.com
jesse at bestpractical.com
Fri Apr 22 13:25:26 EDT 2005
Author: jesse
Date: Fri Apr 22 13:25:25 2005
New Revision: 2801
Modified:
rt/branches/3.0-MAINT/ (props changed)
rt/branches/3.0-MAINT/lib/RT/EmailParser.pm
Log:
r14353 at hualien: jesse | 2005-04-22 13:24:44 -0400
* Even more error trapping for possible out-of-disk conditions on
email ticket creation.
Modified: rt/branches/3.0-MAINT/lib/RT/EmailParser.pm
==============================================================================
--- rt/branches/3.0-MAINT/lib/RT/EmailParser.pm (original)
+++ rt/branches/3.0-MAINT/lib/RT/EmailParser.pm Fri Apr 22 13:25:25 2005
@@ -591,10 +591,16 @@
my $parser = shift;
# Set up output directory for files:
+ eval {
+ my $tmpdir = File::Temp::tempdir( TMPDIR => 1, CLEANUP => 1 );
+ push ( @{ $self->{'AttachmentDirs'} }, $tmpdir );
+ $parser->output_dir($tmpdir);
+
+ };
+ if ($@) {
+ $RT::Logger->crit("Failed to create a temp directory for MIME Decoding: $@");
- my $tmpdir = File::Temp::tempdir( TMPDIR => 1, CLEANUP => 1 );
- push ( @{ $self->{'AttachmentDirs'} }, $tmpdir );
- $parser->output_dir($tmpdir);
+ }
$parser->filer->ignore_filename(1);
#If someone includes a message, extract it
@@ -614,7 +620,7 @@
sub DESTROY {
my $self = shift;
- File::Path::rmtree([@{$self->{'AttachmentDirs'}}],0,1);
+ File::Path::rmtree([@{$self->{'AttachmentDirs'}}],0,1) if exists $self->{'AttachmentDirs'};
}
More information about the Rt-commit
mailing list