Commit 869781a3 authored by sikeda's avatar sikeda
Browse files

[-bug] Now temporary files used to parse messages are stored in the directory...

[-bug] Now temporary files used to parse messages are stored in the directory specified by tmpdir parameter.  Until 6.2beta, temporary files were stored in system temporary directory (/tmp) and occasional disk full occurred.  During 6.2 to 6.2.4, temporary files were stored in-core and excessive memory was consumed.


git-svn-id: https://subversion.renater.fr/sympa/branches/sympa-6.2-branch@12344 05aa8bb8-cd2b-0410-b1d7-8918dfa770ce
parent 35fc1d86
......@@ -147,7 +147,7 @@ sub new {
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
$parser->tmp_to_core(1);
$parser->tmp_dir($Conf::Conf{'tmpdir'});
my $entity = $parser->parse_data(\$serialized);
unless ($entity) {
$log->syslog('err', 'Unable to parse message');
......@@ -979,7 +979,7 @@ sub as_entity {
my $parser = MIME::Parser->new();
$parser->output_to_core(1);
$parser->tmp_to_core(1);
$parser->tmp_dir($Conf::Conf{'tmpdir'});
$self->{_entity_cache} = $parser->parse_data(\$string);
}
return $self->{_entity_cache};
......@@ -1264,7 +1264,7 @@ sub smime_decrypt {
}
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
$parser->tmp_to_core(1);
$parser->tmp_dir($Conf::Conf{'tmpdir'});
$entity = $parser->parse_data($msg_string);
unless (defined $entity) {
$log->syslog('err', 'Message could not be decrypted');
......@@ -1371,7 +1371,7 @@ sub smime_encrypt {
## Get as MIME object
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
$parser->tmp_to_core(1);
$parser->tmp_dir($Conf::Conf{'tmpdir'});
unless ($entity = $parser->parse_data($msg_string)) {
$log->syslog('notice', 'Unable to parse message');
return undef;
......@@ -1452,7 +1452,7 @@ sub smime_sign {
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
$parser->tmp_to_core(1);
$parser->tmp_dir($Conf::Conf{'tmpdir'});
unless ($signed_msg = $parser->parse_data($msg_string)) {
$log->syslog('notice', 'Unable to parse message');
return undef;
......@@ -1881,7 +1881,7 @@ sub prepare_message_according_to_mode {
$parser->extract_nested_messages(0);
$parser->extract_uuencode(1);
$parser->output_to_core(1);
$parser->tmp_to_core(1);
$parser->tmp_dir($Conf::Conf{'tmpdir'});
my $msg_string = $self->as_string;
$msg_string =~ s/\AReturn-Path: (.*?)\n(?![ \t])//s;
......@@ -1989,7 +1989,7 @@ sub _decorate_parts {
## MIME footer/header
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
$parser->tmp_to_core(1);
$parser->tmp_dir($Conf::Conf{'tmpdir'});
if ( $eff_type =~ /^multipart\/alternative/i
|| $eff_type =~ /^multipart\/related/i) {
......@@ -2376,7 +2376,7 @@ sub _urlize_one_part {
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
$parser->tmp_to_core(1);
$parser->tmp_dir($Conf::Conf{'tmpdir'});
my $new_part;
my $charset = tools::lang2charset($language->get_lang);
......@@ -2443,7 +2443,7 @@ sub reformat_utf8_message {
my $parser = MIME::Parser->new();
$parser->output_to_core(1);
$parser->tmp_to_core(1);
$parser->tmp_dir($Conf::Conf{'tmpdir'});
$entity->head->delete('X-Mailer');
_fix_utf8_parts($entity, $parser, $attachments, $defcharset);
......@@ -3010,7 +3010,7 @@ sub get_plaindigest_body {
# Reparse message to extract UUEncode.
my $parser = MIME::Parser->new;
$parser->output_to_core(1);
$parser->tmp_to_core(1);
$parser->tmp_dir($Conf::Conf{'tmpdir'});
$parser->extract_uuencode(1);
$parser->extract_nested_messages(1);
my $topent = $parser->parse_data($self->as_string);
......
......@@ -490,7 +490,7 @@ sub process_message {
my $parser = MIME::Parser->new;
$parser->extract_nested_messages(0);
$parser->output_to_core(1);
$parser->tmp_to_core(1);
$parser->tmp_dir($Conf::Conf{'tmpdir'});
my $entity = $parser->parse_data($message->as_string);
# Get list context from List-Id: field in the third part of report.
......@@ -838,7 +838,7 @@ sub _parse_multipart_report {
my $parser = MIME::Parser->new;
$parser->extract_nested_messages(0);
$parser->output_to_core(1);
$parser->tmp_to_core(1);
$parser->tmp_dir($Conf::Conf{'tmpdir'});
my $entity = $parser->parse_data($message->as_string);
return
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment