@@ -20,7 +20,7 @@ use strict;
20
20
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21
21
# or visit http://www.gnu.org/copyleft/gpl.html
22
22
#
23
- # 20050527 raf <raf@raf.org>
23
+ # 20050528 raf <raf@raf.org>
24
24
25
25
=head1 NAME
26
26
@@ -318,7 +318,7 @@ C<http://raf.org/minimail/>
318
318
319
319
=head1 AUTHOR
320
320
321
- 20050527 raf <raf@raf.org>
321
+ 20050528 raf <raf@raf.org>
322
322
323
323
=head1 URL
324
324
@@ -705,7 +705,7 @@ sub newmail # rfc2822, rfc2045, rfc2046, rfc2183 (also rfc3282, rfc3066, rfc2424
705
705
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 ;
706
706
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 ;
707
707
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 };
709
709
append_header($m , " Content-@{[ucfirst $_ ]}: $a {$_ }" ) for grep { $a {$_ } } qw( description language duration location base features alternative) ;
710
710
append_header($m , " Content-@{[uc $_ ]}: $a {$_ }" ) for grep { $a {$_ } } qw( id md5) ;
711
711
($m -> {mime_type }, $m -> {mime_boundary }, $m -> {mime_parts }) = ($type =~ / ^\s *([\w\/ .-]+)/ , $bound , $a {parts } || []) if $multi ;
@@ -1014,7 +1014,7 @@ sub textmail
1014
1014
1015
1015
if ($remove_html && isa($parts [$i ], 'text/html'))
1016
1016
{
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);
1018
1018
next;
1019
1019
}
1020
1020
@@ -1120,6 +1120,7 @@ sub translate
1120
1120
my $origpath = filename($part );
1121
1121
my $textpath = $origpath ;
1122
1122
$textpath =~ s/\. (?:@{[join '|', @ext ]})$/ .$fmt /i;
1123
+ $textpath .= ".$fmt " unless $textpath =~ /\.\Q $fmt \E $/i;
1123
1124
return newmail(filename => $textpath , body => '') if !defined $cmd && $force ;
1124
1125
my $origdata = body($part );
1125
1126
open A, ">$tmp /$origpath " and do { print A $origdata ; close A };
0 commit comments