Skip to content

Commit b44a6fa

Browse files
committed
20050528
- Fixed translation of content with no file name extensions - Stopped creating Content-Disposition parameters (except filename and size)
1 parent aa1c398 commit b44a6fa

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

CHANGELOG

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
20050528
2+
3+
- Fixed translation of content with no file name extensions
4+
- Stopped creating Content-Disposition parameters (except filename and size)
5+
16
20050527
27

38
- Fixed mail2multipart/mail2singlepart for message/rfc822 messages

textmail

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use strict;
2020
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
2121
# or visit http://www.gnu.org/copyleft/gpl.html
2222
#
23-
# 20050527 raf <raf@raf.org>
23+
# 20050528 raf <raf@raf.org>
2424

2525
=head1 NAME
2626
@@ -318,7 +318,7 @@ C<http://raf.org/minimail/>
318318
319319
=head1 AUTHOR
320320
321-
20050527 raf <raf@raf.org>
321+
20050528 raf <raf@raf.org>
322322
323323
=head1 URL
324324
@@ -705,7 +705,7 @@ sub newmail # rfc2822, rfc2045, rfc2046, rfc2183 (also rfc3282, rfc3066, rfc2424
705705
use Sys::Hostname; append_header($m, "Message-ID: <@{[time]}.$$.@{[++$unique]}\@@{[hostname]}>") if grep { /^(?:date|from|sender|reply-to)$/i } keys %a and !grep { /^message-id$/i } keys %a;
706706
append_header($m, "Content-Type: $type" . ($bound ? newparam('boundary', $bound) : '') . ($char =~ /^us-ascii$/i ? '' : newparam('charset', $char))) unless $type =~ /^text\/plain$/i && $char =~ /^us-ascii$/i;
707707
append_header($m, "Content-Transfer-Encoding: $enc") unless $enc =~ /^7bit$/i;
708-
append_header($m, "Content-Disposition: $disp" . ($a{filename} ? newparam('filename', $a{filename}) : '') . ($a{created} ? newparam('creation-date', $a{created}) : '') . ($a{modified} ? newparam('modification-date', $a{modified}) : '') . ($a{read} ? newparam('read-date', $a{read}) : '') . ($a{size} ? newparam('size', $a{size}) : '')) if $a{filename} || $a{created} || $a{modified} || $a{read} || $a{size};
708+
append_header($m, "Content-Disposition: $disp" . ($a{filename} ? newparam('filename', $a{filename}) : '') . ($a{size} ? newparam('size', $a{size}) : '')) if $a{filename} || $a{size};
709709
append_header($m, "Content-@{[ucfirst $_]}: $a{$_}") for grep { $a{$_} } qw(description language duration location base features alternative);
710710
append_header($m, "Content-@{[uc $_]}: $a{$_}") for grep { $a{$_} } qw(id md5);
711711
($m->{mime_type}, $m->{mime_boundary}, $m->{mime_parts}) = ($type =~ /^\s*([\w\/.-]+)/, $bound, $a{parts} || []) if $multi;
@@ -1014,7 +1014,7 @@ sub textmail
10141014
10151015
if ($remove_html && isa($parts[$i], 'text/html'))
10161016
{
1017-
$parts[$i] = translate($parts[$i], 'html,htm', 'txt', (defined $lynx) ? "$lynx -dump" : undef);
1017+
$parts[$i] = translate($parts[$i], 'html,htm', 'txt', (defined $lynx) ? "$lynx -dump -force_html" : undef);
10181018
next;
10191019
}
10201020
@@ -1120,6 +1120,7 @@ sub translate
11201120
my $origpath = filename($part);
11211121
my $textpath = $origpath;
11221122
$textpath =~ s/\.(?:@{[join '|', @ext]})$/.$fmt/i;
1123+
$textpath .= ".$fmt" unless $textpath =~ /\.\Q$fmt\E$/i;
11231124
return newmail(filename => $textpath, body => '') if !defined $cmd && $force;
11241125
my $origdata = body($part);
11251126
open A, ">$tmp/$origpath" and do { print A $origdata; close A };

0 commit comments

Comments
 (0)