}
my $str = $eml->header_obj->as_string;
$str =~ s/$hdrs_re//g;
+ $str =~ s/(?<!\r)\n/\r\n/sg;
$str .= "\r\n";
}
$eml = eml_body_idx($eml, $section_idx) or return;
}
my $str = $eml->header_obj->as_string;
- join('', ($str =~ m/($hdrs_re)/g), "\r\n");
+ $str = join('', ($str =~ m/($hdrs_re)/g));
+ $str =~ s/(?<!\r)\n/\r\n/sg;
+ $str .= "\r\n";
}
sub partial_prepare ($$$$) {
: \&partial_hdr_get,
$1, undef, $4, $5 ];
$tmp->[2] = hdrs_regexp($3);
- $$need |= CRLF_HDR|EML_HDR;
+
+ # don't emit CRLF_HDR instruction, here, partial_hdr_*
+ # will do CRLF conversion with only the extracted result
+ # and not waste time converting lines we don't care about.
+ $$need |= EML_HDR;
} else {
undef;
}