*** omail.pl.orig Sat Nov 18 23:52:50 2000
--- omail.pl Thu Nov 30 19:23:11 2000
***************
*** 1134,1139 ****
--- 1134,1140 ----
$body = $message{"body"} || '';
+ $body = Jcode->new($body)->euc if($lang eq 'ja');
$body =~ s/</g;
$body =~ s/>/>/g;
$body =~ s/\n/
\n/g;
***************
*** 1307,1312 ****
--- 1308,1316 ----
if (($attnumber == 0) &&
(${$message{attachment}[$attnumber]}{contenttype} =~ /^text\/plain$/i)) {
print hr();
+ ${$message{attachment}[$attnumber]}{contents} = Jcode->new(
+ ${$message{attachment}[$attnumber]}{contents} )->euc
+ if($lang eq 'ja');
${$message{attachment}[$attnumber]}{contents} =~ s/</g;
${$message{attachment}[$attnumber]}{contents} =~ s/>/>/g;
${$message{attachment}[$attnumber]}{contents} =~ s/\n/
\n/g;
***************
*** 1564,1570 ****
if (($composetype eq "reply") || ($composetype eq "replyall")) {
$subject = $message{"subject"} || '';
$subject = "Re: " . $message{"subject"} unless ($message{"subject"} =~ /^re:/i);
- #koj@syon.co.jp
$message{references} = '' if($message{references} eq 'N/A');
$references = " $message{references} <$message{messageid_header}>";
$inreplyto = " <$message{messageid_header}>";
--- 1569,1574 ----
***************
*** 1663,1669 ****
print hidden(-name=>'folder',
-default=>$folder,
-override=>'1');
- # koj@syon.co.jp
print hidden(-name=>'references',
-default=>$references,
-override=>'1');
--- 1667,1672 ----
***************
*** 1840,1859 ****
$attname =~ s/^.*\///;
$attname =~ s/^.*://;
! $header_from = "From: $realname <$from>\n";
! $header_subject = "Subject: $subject\n";
if ($lang eq 'ja') {
! $header_from = &mime_unstructured_header($header_from);
! $header_subject = &mime_unstructured_header($header_subject);
$body = &convert2jis($body);
}
open (SENDMAIL, "|" . $sendmail . " -oem -oi -F '$realname' -f '$from' -t 1>&2") or omailerror("Can't run $sendmail!");
# print SENDMAIL "From: $realname <$from>\n";
# $messagecontents .= "From: $realname <$from>\n";
! print SENDMAIL $header_from;
! $messagecontents .= $header_from;
$messagecontents .= "Date: " . localtime() . "\n";
print SENDMAIL "To: $to\n";
$messagecontents .= "To: $to\n";
--- 1843,1863 ----
$attname =~ s/^.*\///;
$attname =~ s/^.*://;
! $header_from = "From: $realname <$from>";
! $header_subject = "Subject: $subject";
if ($lang eq 'ja') {
! $to = Jcode->new($to)->mime_encode;
! $header_from = Jcode->new($header_from)->mime_encode;
! $header_subject = Jcode->new($header_subject)->mime_encode;
$body = &convert2jis($body);
}
open (SENDMAIL, "|" . $sendmail . " -oem -oi -F '$realname' -f '$from' -t 1>&2") or omailerror("Can't run $sendmail!");
# print SENDMAIL "From: $realname <$from>\n";
# $messagecontents .= "From: $realname <$from>\n";
! print SENDMAIL "$header_from\n";
! $messagecontents .= "$header_from\n";
$messagecontents .= "Date: " . localtime() . "\n";
print SENDMAIL "To: $to\n";
$messagecontents .= "To: $to\n";
***************
*** 1865,1873 ****
$messagecontents .= "Reply-to: $replyto\n" if $replyto;
# print SENDMAIL "Subject: $subject\n";
# $messagecontents .= "Subject: $subject\n";
! print SENDMAIL $header_subject;
! $messagecontents .= $header_subject;
! # koj@syon.co.jp
print SENDMAIL "References: $references\n";
$messagecontents .= "References: $references\n";
print SENDMAIL "In-Reply-To: $inreplyto\n";
--- 1869,1876 ----
$messagecontents .= "Reply-to: $replyto\n" if $replyto;
# print SENDMAIL "Subject: $subject\n";
# $messagecontents .= "Subject: $subject\n";
! print SENDMAIL "$header_subject\n";
! $messagecontents .= "$header_subject\n";
print SENDMAIL "References: $references\n";
$messagecontents .= "References: $references\n";
print SENDMAIL "In-Reply-To: $inreplyto\n";
***************
*** 1878,1890 ****
$messagecontents .= "X-IPAddress: $ENV{REMOTE_ADDR}\n";
print SENDMAIL "X-Sender: $user\@$domainname\n";
$messagecontents .= "X-Sender: $user\@$domainname\n";
- # add 2000/10/03 koj
- if($TXT{'charset'} ne '') {
- print SENDMAIL "Content-Type: text/plain; charset=$TXT{'charset'}\n";
- $messagecontents .= "Content-Type: text/plain; charset=$TXT{'charset'}\n";
- print SENDMAIL "Content-Transfer-Encoding: 7bit\n";
- $messagecontents .= "Content-Transfer-Encoding: 7bit\n";
- }
if ($attachment) {
no strict 'refs';
--- 1881,1886 ----
***************
*** 1904,1911 ****
$messagecontents .= "This is a multi-part message in MIME format.\n\n";
print SENDMAIL "--$boundary\n";
$messagecontents .= "--$boundary\n";
! print SENDMAIL "Content-Type: text/plain; charset=US-ASCII\n\n";
! $messagecontents .= "Content-Type: text/plain; charset=US-ASCII\n\n";
print SENDMAIL $body;
$messagecontents .= $body;
print SENDMAIL "\n\n--$boundary\n";
--- 1900,1909 ----
$messagecontents .= "This is a multi-part message in MIME format.\n\n";
print SENDMAIL "--$boundary\n";
$messagecontents .= "--$boundary\n";
! print SENDMAIL "Content-Type: text/plain; charset=$TXT{'charset'}\n";
! $messagecontents .= "Content-Type: text/plain; charset=$TXT{'charset'}\n";
! print SENDMAIL "Content-Transfer-Encoding: 7bit\n\n";
! $messagecontents .= "Content-Transfer-Encoding: 7bit\n\n";
print SENDMAIL $body;
$messagecontents .= $body;
print SENDMAIL "\n\n--$boundary\n";
***************
*** 1918,1923 ****
--- 1916,1925 ----
print SENDMAIL "$attcontents\n--$boundary--";
$messagecontents .= "$attcontents\n--$boundary--";
} else {
+ print SENDMAIL "Content-Type: text/plain; charset=$TXT{'charset'}\n";
+ $messagecontents .= "Content-Type: text/plain; charset=$TXT{'charset'}\n";
+ print SENDMAIL "Content-Transfer-Encoding: 7bit\n";
+ $messagecontents .= "Content-Transfer-Encoding: 7bit\n";
print SENDMAIL "\n$body\n";
$messagecontents .= "\n$body\n";
}
***************
*** 2902,2908 ****
sub convert2jis {
my $str = shift;
! $str = &Jcode::convert(\$str, 'jis', Jcode::getcode(\$str), "z");
return $str;
}
--- 2904,2911 ----
sub convert2jis {
my $str = shift;
! $str = Jcode->new($str)->iso_2022_jp;
! # $str = &Jcode::convert(\$str, 'jis', Jcode::getcode(\$str), "z");
return $str;
}
***************
*** 3153,3159 ****
$headerprinted = 1;
if (!$TXT{'charset'}) { $TXT{'charset'} = "iso-8859-1"; }
! if (!$TXT{'charset_http'}) { $TXT{'charset_http'} = "iso-8859-1"; } #koj
my $charset_http ='';
$charset_http = $TXT{'charset_http'} ? $TXT{'charset_http'}:$TXT{'charset'};
--- 3156,3162 ----
$headerprinted = 1;
if (!$TXT{'charset'}) { $TXT{'charset'} = "iso-8859-1"; }
! if (!$TXT{'charset_http'}) { $TXT{'charset_http'} = "iso-8859-1"; }
my $charset_http ='';
$charset_http = $TXT{'charset_http'} ? $TXT{'charset_http'}:$TXT{'charset'};
***************
*** 3232,3322 ****