diff options
| -rw-r--r-- | img/lib/IM/Address.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Alias.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Config.pm.in | 17 | ||||
| -rw-r--r-- | img/lib/IM/EncDec.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/File.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Folder.pm | 5 | ||||
| -rw-r--r-- | img/lib/IM/GetPass.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Grep.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/History.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Http.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Imap.pm | 12 | ||||
| -rw-r--r-- | img/lib/IM/Iso2022jp.pm | 6 | ||||
| -rw-r--r-- | img/lib/IM/Japanese.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/LocalMbox.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Log.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/MD5.pm | 19 | ||||
| -rw-r--r-- | img/lib/IM/Message.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/MsgStore.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Nntp.pm | 17 | ||||
| -rw-r--r-- | img/lib/IM/Pop.pm | 10 | ||||
| -rw-r--r-- | img/lib/IM/Recipient.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Scan.pm | 15 | ||||
| -rw-r--r-- | img/lib/IM/Smtp.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Ssh.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Stdio.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/TcpTransaction.pm | 74 | ||||
| -rw-r--r-- | img/lib/IM/Util.pm | 4 |
27 files changed, 114 insertions, 133 deletions
diff --git a/img/lib/IM/Address.pm b/img/lib/IM/Address.pm index 98d5b344..ba5129cd 100644 --- a/img/lib/IM/Address.pm +++ b/img/lib/IM/Address.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Address.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Address.pm version 20000414(IM141)"; package IM::Address; require 5.003; diff --git a/img/lib/IM/Alias.pm b/img/lib/IM/Alias.pm index a2064329..6a67c068 100644 --- a/img/lib/IM/Alias.pm +++ b/img/lib/IM/Alias.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Alias.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Alias.pm version 20000414(IM141)"; package IM::Alias; require 5.003; diff --git a/img/lib/IM/Config.pm.in b/img/lib/IM/Config.pm.in index e7c33d67..56ebbdb3 100644 --- a/img/lib/IM/Config.pm.in +++ b/img/lib/IM/Config.pm.in @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Config.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Config.pm version 20000414(IM141)"; package IM::Config; require 5.003; @@ -32,13 +32,13 @@ use vars qw(@ISA @EXPORT); mail_dir mail_path news_dir news_path queue_dir queue_path inbox_folder draft_folder trash_folder config_cases config_case_inbox preserve_dot - folder_mode msg_mode allowcrlf no_sync fsync_no + folder_mode msg_mode allowcrlf use_cl no_sync fsync_no addrbook_file aliases_file petname_file context_file getchksbr_file getsbr_file scansbr_file scan_header_pick address addresses_regex msgdbfile msgdbtype mbox_style - nntpservers nntphistoryfile nntpauthuser + nntpservers nntphistoryfile nntpauthuser set_nntpauthuser popaccount pophistoryfile imapaccount httpproxy noproxy usepwagent pwagentport usepwfiles pwfiles expand_path usetouchfile touchfile namazuv2 @@ -105,6 +105,7 @@ BEGIN { 'trashfolder;f;;TrashFolder' => 'Trash folder', 'foldermode;i;;FolderMode' => 'Folder directory mode when created', 'msgmode;i;;MsgMode' => 'Message file mode when created', + 'usecl;b;;UseCL' => 'Use value of Content-Length header for delimitation', 'nosync;b;;NoSync' => 'Do not need fsync(2) on writing file', 'allowcrlf;b;;AllowCRLF' => 'CRLF may be in saved message', 'preservedot;b;;PreserveDot' => 'Not substitute "." with "/"', @@ -789,6 +790,10 @@ sub allowcrlf () { return $AllowCRLF; } +sub use_cl () { + return $UseCL; +} + sub no_sync () { return $NoSync; } @@ -861,6 +866,10 @@ sub nntpauthuser () { return $NNTPauthuser; } +sub set_nntpauthuser($) { + $NNTPauthuser = shift; +} + sub popaccount () { return $POPaccount; } diff --git a/img/lib/IM/EncDec.pm b/img/lib/IM/EncDec.pm index e9b49694..acc1b9a0 100644 --- a/img/lib/IM/EncDec.pm +++ b/img/lib/IM/EncDec.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::EncDec.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::EncDec.pm version 20000414(IM141)"; package IM::EncDec; require 5.003; diff --git a/img/lib/IM/File.pm b/img/lib/IM/File.pm index 8ddb2d4f..0b6c1583 100644 --- a/img/lib/IM/File.pm +++ b/img/lib/IM/File.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Jul 7, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::File.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::File.pm version 20000414(IM141)"; package IM::File; require 5.003; diff --git a/img/lib/IM/Folder.pm b/img/lib/IM/Folder.pm index 4f556bc2..572e8b8d 100644 --- a/img/lib/IM/Folder.pm +++ b/img/lib/IM/Folder.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Folder.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Folder.pm version 20000414(IM141)"; package IM::Folder; require 5.003; @@ -338,6 +338,7 @@ sub touch_folder ($) { $dir = &expand_path($dir); my($file) = ($dir . "/" . &touchfile()); im_open(\*OF,">$file"); + print OF "touched by IM."; close(OF); } elsif (&os2p) { my ($dir) = shift; diff --git a/img/lib/IM/GetPass.pm b/img/lib/IM/GetPass.pm index aeed64f7..ec252fbf 100644 --- a/img/lib/IM/GetPass.pm +++ b/img/lib/IM/GetPass.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 30, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::GetPass.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::GetPass.pm version 20000414(IM141)"; package IM::GetPass; require 5.003; diff --git a/img/lib/IM/Grep.pm b/img/lib/IM/Grep.pm index aed76b84..32bf0c0f 100644 --- a/img/lib/IM/Grep.pm +++ b/img/lib/IM/Grep.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Nov 03, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Grep.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Grep.pm version 20000414(IM141)"; package IM::Grep; require 5.003; diff --git a/img/lib/IM/History.pm b/img/lib/IM/History.pm index 41e69c5f..dad0eb21 100644 --- a/img/lib/IM/History.pm +++ b/img/lib/IM/History.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Jul 6, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::History.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::History.pm version 20000414(IM141)"; package IM::History; require 5.003; diff --git a/img/lib/IM/Http.pm b/img/lib/IM/Http.pm index 7f0c8f21..59ff1f8d 100644 --- a/img/lib/IM/Http.pm +++ b/img/lib/IM/Http.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Http.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Http.pm version 20000414(IM141)"; package IM::Http; require 5.003; diff --git a/img/lib/IM/Imap.pm b/img/lib/IM/Imap.pm index 51e90f56..32583f9c 100644 --- a/img/lib/IM/Imap.pm +++ b/img/lib/IM/Imap.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Imap.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Imap.pm version 20000414(IM141)"; package IM::Imap; require 5.003; @@ -72,11 +72,13 @@ sub imap_open ($$$$) { } my $failed = 0; if ($auth eq 'LOGIN') { - my $pw = $pass; + my ($us, $pw) = ($user, $pass); + $us =~ s/([\\"])/\\$1/g; # escape specials + $us = "\"$us\""; # quote it $pw =~ s/([\\"])/\\$1/g; # escape specials $pw = "\"$pw\""; # quote it - $resp = &send_command($HANDLE, "im$seq LOGIN $user $pw", - "im$seq LOGIN $user PASSWORD"); + $resp = &send_command($HANDLE, "im$seq LOGIN $us $pw", + "im$seq LOGIN $us PASSWORD"); while ($resp !~ /^im$seq/) { if ($resp =~ /^\* NO/i) { # $failed = 1; diff --git a/img/lib/IM/Iso2022jp.pm b/img/lib/IM/Iso2022jp.pm index 76746dc0..98f5959b 100644 --- a/img/lib/IM/Iso2022jp.pm +++ b/img/lib/IM/Iso2022jp.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Iso2022jp.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Iso2022jp.pm version 20000414(IM141)"; package IM::Iso2022jp; require 5.003; @@ -432,7 +432,7 @@ sub word_iso2022jp_mimefy ($$$$) { } $word_out .= $Jp_out; } - if ($word_in) { + if ($word_in ne '') { $word_out .= "\n\t"; } $size = $main::Folding_length; diff --git a/img/lib/IM/Japanese.pm b/img/lib/IM/Japanese.pm index 564e94b5..08948d60 100644 --- a/img/lib/IM/Japanese.pm +++ b/img/lib/IM/Japanese.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Japanese.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Japanese.pm version 20000414(IM141)"; package IM::Japanese; require 5.003; diff --git a/img/lib/IM/LocalMbox.pm b/img/lib/IM/LocalMbox.pm index ce1628ff..8a38fde1 100644 --- a/img/lib/IM/LocalMbox.pm +++ b/img/lib/IM/LocalMbox.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::LocalMbox.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::LocalMbox.pm version 20000414(IM141)"; package IM::LocalMbox; require 5.003; diff --git a/img/lib/IM/Log.pm b/img/lib/IM/Log.pm index d7949694..0bb84e07 100644 --- a/img/lib/IM/Log.pm +++ b/img/lib/IM/Log.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Log.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Log.pm version 20000414(IM141)"; package IM::Log; require 5.003; diff --git a/img/lib/IM/MD5.pm b/img/lib/IM/MD5.pm index b03b5184..ba9fe4f7 100644 --- a/img/lib/IM/MD5.pm +++ b/img/lib/IM/MD5.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::MD5.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::MD5.pm version 20000414(IM141)"; package IM::MD5; require 5.003; @@ -106,10 +106,10 @@ sub md5_str ($) { # F, G, H and I are basic MD5 functions. -sub MD5_F {my($x, $y, $z) = @_; ((($x) & ($y)) | ((~$x) & ($z))); } -sub MD5_G {my($x, $y, $z) = @_; ((($x) & ($z)) | (($y) & (~$z))); } +sub MD5_F {my($x, $y, $z) = @_; ((($x) & ($y)) | (&MD5_trunc(~$x) & ($z))); } +sub MD5_G {my($x, $y, $z) = @_; ((($x) & ($z)) | (($y) & &MD5_trunc(~$z))); } sub MD5_H {my($x, $y, $z) = @_; (($x) ^ ($y) ^ ($z)); } -sub MD5_I {my($x, $y, $z) = @_; (($y) ^ (($x) | (~$z))); } +sub MD5_I {my($x, $y, $z) = @_; (($y) ^ (($x) | &MD5_trunc(~$z))); } # ROTATE_LEFT rotates x left n bits. @@ -155,8 +155,13 @@ sub MD5_II { sub MD5_trunc { my($x) = @_; - while ($x >= 4294967296) { - $x -= 4294967296; + + if (($x | 0) == $x) { + $x &= 0xffffffff; + } else { + while ($x >= 4294967296) { + $x -= 4294967296; + } } return $x; } diff --git a/img/lib/IM/Message.pm b/img/lib/IM/Message.pm index e920dbd5..c96afaa4 100644 --- a/img/lib/IM/Message.pm +++ b/img/lib/IM/Message.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Message.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Message.pm version 20000414(IM141)"; package IM::Message; require 5.003; diff --git a/img/lib/IM/MsgStore.pm b/img/lib/IM/MsgStore.pm index ffe8401c..61a1c90e 100644 --- a/img/lib/IM/MsgStore.pm +++ b/img/lib/IM/MsgStore.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::MsgStore.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::MsgStore.pm version 20000414(IM141)"; package IM::MsgStore; require 5.003; diff --git a/img/lib/IM/Nntp.pm b/img/lib/IM/Nntp.pm index cc87e7a7..49b50cd8 100644 --- a/img/lib/IM/Nntp.pm +++ b/img/lib/IM/Nntp.pm @@ -5,17 +5,18 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Nntp.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Nntp.pm version 20000414(IM141)"; package IM::Nntp; require 5.003; require Exporter; use Fcntl; -use IM::Config qw(nntphistoryfile nntpservers nntpauthuser nntp_timeout); +use IM::Config qw(nntphistoryfile nntpservers nntpauthuser set_nntpauthuser + nntp_timeout); use IM::TcpTransaction; use IM::Util; use integer; @@ -45,7 +46,7 @@ NNTP - NNTP interface package =head1 SYNOPSIS $return_code = &nntp_transaction(server_list, newsgroups, - part_current, part_total); + part_current, part_total, authuser); $return_code = &nntp_close; =head1 DESCRIPTION @@ -105,22 +106,24 @@ sub nntp_close () { ##### NNTP TRANSACTION MANAGEMENT ##### # -# nntp_transaction(server_list, header, body, group, part, total) +# nntp_transaction(server_list, header, body, group, part, total, authuser) # server_list: list of NNTP servers # group: news group to be posted in # part: part number to be sent in partial message mode # total: total number of partial messages +# authuser: User name for NNTP authentication # return value: # 0: success # 1: recoverable error (should be retried) # -1: unrecoverable error # -sub nntp_transaction ($$$$$$) { - my ($servers, $Header, $Body, $group, $part, $total) = @_; +sub nntp_transaction ($$$$$$$) { + my ($servers, $Header, $Body, $group, $part, $total, $authuser) = @_; my $rc; require IM::Log && import IM::Log; + &set_nntpauthuser($authuser); do { $rc = &nntp_transact_sub($servers, $Header, $Body, $part, $total); my (@resp) = &command_response; diff --git a/img/lib/IM/Pop.pm b/img/lib/IM/Pop.pm index d165474e..feb28f22 100644 --- a/img/lib/IM/Pop.pm +++ b/img/lib/IM/Pop.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Pop.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Pop.pm version 20000414(IM141)"; package IM::Pop; require 5.003; @@ -142,7 +142,7 @@ sub pop_stat () { im_warn("STAT command failed.\n"); return -1; } - @field = split(' ', $resp); + @field = split(/\s+/, $resp); im_notice("$field[1] message(s) found.\n"); return $field[1]; } @@ -260,7 +260,7 @@ sub pop_uidl ($) { s/\r\n$/\n/; last if ($_ =~ /^\.\n$/); im_debug($_) if (&debug('pop')); - if (/^(\d+)\s(\S+)$/) { + if (/^(\d+)\s+(\S+)$/) { $$uidlp[$1] = $2; } } @@ -321,7 +321,7 @@ sub pop_process ($$$$) { if ($resp !~ /^\+/) { im_warn("LAST command failed.\n"); } else { - $resp =~ /\+OK (\d+)/i; + $resp =~ /\+OK\s+(\d+)/i; $last = $1; } # } elsif ($keep_proto eq 'STATUS') { diff --git a/img/lib/IM/Recipient.pm b/img/lib/IM/Recipient.pm index 8efb590d..353df12b 100644 --- a/img/lib/IM/Recipient.pm +++ b/img/lib/IM/Recipient.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 27, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Recipient.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Recipient.pm version 20000414(IM141)"; package IM::Recipient; require 5.003; diff --git a/img/lib/IM/Scan.pm b/img/lib/IM/Scan.pm index f3765bf8..9c14d9c9 100644 --- a/img/lib/IM/Scan.pm +++ b/img/lib/IM/Scan.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Scan.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Scan.pm version 20000414(IM141)"; package IM::Scan; require 5.003; @@ -781,7 +781,7 @@ sub substr_safe ($$) { my $i; if ($room % 2 and $charset =~ - /^(jisx0208|jisx0212|ksc5601|cns11643-plane-2)/) { + /^(jisx0208|jisx0212|jisx0213|ksc5601|cns11643-plane-2|big5-1|big5-2)/) { $room--; $last_char = ' '; } @@ -810,6 +810,9 @@ sub substr_safe ($$) { elsif (s/(^\e\$\(C)//) { $G1 = $charset = 'ksc5601-1987'; $G0 = 'ascii'; } + elsif (s/(^\e\$\(O)//) { $G0 = $charset = 'jisx0213-1'; } + elsif (s/(^\e\$\(P)//) { $G0 = $charset = 'jisx0213-2'; } + elsif (s/(^\e-A)//) { $G1 = $charset = 'iso8859-1'; } elsif (s/(^\e-B)//) { $G1 = $charset = 'iso8859-2'; } elsif (s/(^\e-C)//) { $G1 = $charset = 'iso8859-3'; } @@ -834,6 +837,10 @@ sub substr_safe ($$) { $G0 = 'ascii'; } elsif (s/(^\e\$\*H)//) { $G2 = $charset = 'cns11643-plane-2'; $G0 = 'ascii';} + + elsif (s/(^\e\$\(0)//) { $G0 = $charset = 'big5-1';} + elsif (s/(^\e\$\(1)//) { $G0 = $charset = 'big5-2';} + elsif (s/(^\e)//) { ; } @@ -845,7 +852,7 @@ sub substr_safe ($$) { join ('', @res, - $charset =~ /^jisx02/ ? "\e(B" : '', + ($G0 ne 'ascii') ? "\e(B" : '', $shift_in, $last_char, $fill_char x ($len - $count), diff --git a/img/lib/IM/Smtp.pm b/img/lib/IM/Smtp.pm index a14a798c..b913a2e4 100644 --- a/img/lib/IM/Smtp.pm +++ b/img/lib/IM/Smtp.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Smtp.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Smtp.pm version 20000414(IM141)"; package IM::Smtp; require 5.003; diff --git a/img/lib/IM/Ssh.pm b/img/lib/IM/Ssh.pm index 00756727..bcac3f39 100644 --- a/img/lib/IM/Ssh.pm +++ b/img/lib/IM/Ssh.pm @@ -5,10 +5,10 @@ ### ### Author: Masatoshi Tsuchiya <tsuchiya@pine.kuee.kyoto-u.ac.jp> ### Created: Oct 05, 1999 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Ssh.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Ssh.pm version 20000414(IM141)"; package IM::Ssh; require 5.003; diff --git a/img/lib/IM/Stdio.pm b/img/lib/IM/Stdio.pm index efa95194..c247e6b1 100644 --- a/img/lib/IM/Stdio.pm +++ b/img/lib/IM/Stdio.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: May 7, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Stdio.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Stdio.pm version 20000414(IM141)"; package IM::Stdio; require 5.003; diff --git a/img/lib/IM/TcpTransaction.pm b/img/lib/IM/TcpTransaction.pm index 39d1768c..389d47c6 100644 --- a/img/lib/IM/TcpTransaction.pm +++ b/img/lib/IM/TcpTransaction.pm @@ -5,16 +5,19 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::TcpTransaction.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::TcpTransaction.pm version 20000414(IM141)"; package IM::TcpTransaction; require 5.003; require Exporter; use IM::Config qw(dns_timeout connect_timeout command_timeout rcv_buf_siz); use Socket; +BEGIN { + eval 'use Socket6' unless (eval '&AF_INET6'); # IPv6 patched Perl +} use IM::Util; use IM::Ssh; use integer; @@ -122,7 +125,7 @@ sub connect_server ($$$) { } $0 = progname() . ": im_getaddrinfo($s)"; @he_infos = im_getaddrinfo($s, $remoteport, AF_UNSPEC, SOCK_STREAM); - if ($#he_infos < 0) { + if ($#he_infos < 1) { im_warn("address unknown for $s\n"); @Response = ("address unknown for $s"); if ($serv eq 'smtp') { @@ -147,7 +150,7 @@ sub connect_server ($$$) { if ($family == AF_INET) { $port = (unpack_sockaddr_in($sin))[0]; } else { - $port = (inet6_unpack_sockaddr_in6($sin))[0]; + $port = (unpack_sockaddr_in6($sin))[0]; } *SOCK = \*{$name}; $SOCK = $port; @@ -364,7 +367,10 @@ sub pool_priv_sock ($) { my $count = shift; pool_priv_sock_af($count, AF_INET); - pool_priv_sock_af($count, inet6_family()) if (eval '&AF_INET6'); + if (eval 'pack_sockaddr_in6(110, pack("N4", 0, 0, 0, 0))') { + no strict 'subs'; # XXX for AF_INET6 + pool_priv_sock_af($count, AF_INET6); + } } sub pool_priv_sock_af ($$) { @@ -391,7 +397,7 @@ sub pool_priv_sock_af ($$) { $psin = pack_sockaddr_in($privport, $ANYADDR); } else { $ANYADDR = pack('N4', 0, 0, 0, 0); - $psin = inet6_pack_sockaddr_in6($privport, $ANYADDR); + $psin = pack_sockaddr_in6($privport, $ANYADDR); } last if (bind (*{$TcpSockName}, $psin)); im_warn("privileged socket binding failed: $!.\n") @@ -448,48 +454,18 @@ sub im_getaddrinfo ($$;$$$$) { my ($he_name, $he_alias, $he_type, $he_len, @he_addrs); if ($node =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) { @he_addrs = (pack('C4', $1, $2, $3, $4)); - $family = AF_INET; - } elsif ($node =~ /^[\da-f:]+$/i) { - if ($node =~ /::.*::/) { - im_err("bad server address in IPv6 format: $node\n"); - return; - } - if ($node =~ /::/) { - (my $t = $node) =~ s/[^:]//g; - my $n = 7 - length($t); - $t = ':0:'; - while ($n--) { - $t .= '0:'; - } - $node =~ s/::/$t/; - } - if ($node =~ /^([\da-f]*):([\da-f]*):([\da-f]*):([\da-f]*):([\da-f]*):([\da-f]*):([\da-f]*):([\da-f]*)$/i) { - @he_addrs = (pack('n8', - hex("0x$1"), hex("0x$2"), hex("0x$3"), hex("0x$4"), - hex("0x$5"), hex("0x$6"), hex("0x$7"), hex("0x$8"))); - $family = inet6_family(); # AF_INET6 - } else { - im_err("bad server address in IPv6 format: $node\n"); - return; - } } else { alarm(dns_timeout()) unless win95p(); ($he_name, $he_alias, $he_type, $he_len, @he_addrs) = gethostbyname($node); alarm(0) unless win95p(); return unless ($he_name); - $family = $he_type; } my ($he_addr, @infos); foreach $he_addr (@he_addrs) { - my $sin; - if ($family == AF_INET) { - $sin = pack_sockaddr_in($se_port, $he_addr); - } else { - $sin = inet6_pack_sockaddr_in6($se_port, $he_addr); - } - push(@infos, $family, $socktype, $pe_proto, $sin, $he_name); + push(@infos, AF_INET, $socktype, $pe_proto, + pack_sockaddr_in($se_port, $he_addr), $he_name); } @infos; } @@ -524,28 +500,6 @@ sub getserv($$) { $se_port; } -sub inet6_pack_sockaddr_in6 ($;$) { - return pack_sockaddr_in6(@_) if (defined &pack_sockaddr_in6); - - my ($port, $he_addr) = @_; - pack('CCnN', 1+1+2+4+16+4, inet6_family(), $port, 0) . $he_addr . - pack('N', 0); -} - -sub inet6_unpack_sockaddr_in6 ($) { - return unpack_sockaddr_in6(@_) if (defined &unpack_sockaddr_in6); - - my $sock = shift; - my ($len, $family, $port, $flow, $a1, $a2, $a3, $a4) - = unpack('CCnNN4', $sock); - my $addr = pack('N4', $a1, $a2, $a3, $a4); - ($port, $addr); -} - -sub inet6_family () { - return eval '&AF_INET6' || 24; -} - 1; ### Copyright (C) 1997, 1998, 1999 IM developing team diff --git a/img/lib/IM/Util.pm b/img/lib/IM/Util.pm index 0574b54e..8b9235ff 100644 --- a/img/lib/IM/Util.pm +++ b/img/lib/IM/Util.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Feb 28, 2000 +### Revised: Apr 14, 2000 ### -my $PM_VERSION = "IM::Util.pm version 20000228(IM140)"; +my $PM_VERSION = "IM::Util.pm version 20000414(IM141)"; package IM::Util; require 5.003; |
