diff options
Diffstat (limited to 'img/lib/IM')
| -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 | 56 | ||||
| -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 | 10 | ||||
| -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 | 4 | ||||
| -rw-r--r-- | img/lib/IM/Iso2022jp.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Japanese.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/LocalMbox.pm | 26 | ||||
| -rw-r--r-- | img/lib/IM/Log.pm | 10 | ||||
| -rw-r--r-- | img/lib/IM/MD5.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Message.pm | 13 | ||||
| -rw-r--r-- | img/lib/IM/MsgStore.pm | 10 | ||||
| -rw-r--r-- | img/lib/IM/Nntp.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Pop.pm | 16 | ||||
| -rw-r--r-- | img/lib/IM/Recipient.pm | 4 | ||||
| -rw-r--r-- | img/lib/IM/Scan.pm | 27 | ||||
| -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 | 4 | ||||
| -rw-r--r-- | img/lib/IM/Util.pm | 16 |
27 files changed, 165 insertions, 91 deletions
diff --git a/img/lib/IM/Address.pm b/img/lib/IM/Address.pm index b63bc800..3e62e691 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Address.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Address.pm version 20030601(IM145)"; package IM::Address; require 5.003; diff --git a/img/lib/IM/Alias.pm b/img/lib/IM/Alias.pm index 04a50a9f..e5a10a03 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Alias.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Alias.pm version 20030601(IM145)"; package IM::Alias; require 5.003; diff --git a/img/lib/IM/Config.pm.in b/img/lib/IM/Config.pm.in index 7045bda6..85753676 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Config.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Config.pm version 20030601(IM145)"; package IM::Config; require 5.003; @@ -33,7 +33,7 @@ use vars qw(@ISA @EXPORT); inbox_folder draft_folder trash_folder config_cases config_case_inbox preserve_dot folder_mode msg_mode allowcrlf use_cl no_sync fsync_no preferred_fsync_no - addrbook_file aliases_file petname_file + addrbook_file aliases_file petname_file mail_folders_file context_file getchksbr_file getsbr_file scansbr_file scan_header_pick address addresses_regex msgdbfile msgdbtype @@ -41,7 +41,9 @@ use vars qw(@ISA @EXPORT); nntpservers nntphistoryfile nntpauthuser set_nntpauthuser popaccount pophistoryfile imapaccount httpproxy noproxy usepwagent pwagentport pwagent_tmp_dir pwagent_tmp_path usepwfiles pwfiles - expand_path usetouchfile touchfile namazuv2 namazu_lock_dir namazu_lock_path + expand_path use_xdispatcher usetouchfile touchfile + namazuv2 namazu_dir namazu_path namazu_lock_dir namazu_lock_path + mknmz_include_file mknmz_ignore_folders_regex pop_timeout imap_timeout nntp_timeout dns_timeout connect_timeout command_timeout rcv_buf_siz db_type file_attr ssh_path); @@ -114,6 +116,8 @@ BEGIN { 'addrbookfile;s;;AddrBookFile' => 'Address book file', 'aliasesfile;s;;AliasesFile' => 'Aliases file', 'petnamefile;s;;PetNameFile' => 'PetName file', + 'petnamefile;s;;PetNameFile' => 'PetName file', + 'mailfoldersfile;s;;MailFoldersFile' => 'Mail folders file', 'contextfile;s;Context;ContextFile' => 'Context file', 'address;s;;Address' => 'Email addresses', 'addrregex;s;;AddrRegex' => 'Email addresses by regex', @@ -144,10 +148,14 @@ BEGIN { 'connecttimeout;i;60;ConnectTimeout' => 'Timeout for connection making', 'commandtimeout;i;300;CommandTimeout' => 'Timeout for each command', 'rcvbufsiz;i;;RcvBufSiz' => 'Receive buffer size of TCP', + 'usexdispatcher;b;;UseXDispatcher' => 'Use X-Dispatcher field', 'usetouchfile;b;;UseTouchFile' => 'Use touch file', 'touchfile;s;;TouchFile' => 'Touch file name', - 'namazuv2;b;;NamazuV2' => 'Use Namazu Version 2', - 'namazulockdir;s;;NamazuLockDir' => 'Lock directory for immknmz', + 'namazuv2;b;;NamazuV2' => 'Use Namazu Version 2 (1.9 or late)', + 'namazudir;s;;NamazuDir' => 'A directory to contain Namazu indexes', + 'namazulockdir;s;;NamazuLockDir' => 'Lock directory for Namazu', + 'mknmzincludefile;s;;MknmzIncludeFile' => 'A file for mknmz -I', + 'mknmzignorefoldersregex;s;;MknmzIgnoreFoldersRegex' => 'Folders regex ignored by immknmz', ); # these vars should be in current package? @@ -841,6 +849,10 @@ sub petname_file() { return &expand_path($PetNameFile); } +sub mail_folders_file() { + return &expand_path($MailFoldersFile); +} + sub address() { return $Address; } @@ -921,6 +933,10 @@ sub pwfiles() { return $PwFiles; } +sub use_xdispatcher() { + return $UseXDispatcher; +} + sub usetouchfile() { return $UseTouchFile; } @@ -969,6 +985,22 @@ sub namazuv2() { return $NamazuV2; } +sub namazu_dir() { + return $NamazuDir; +} + +sub namazu_path() { + return expand_home(namazu_dir()); +} + +sub mknmz_include_file() { + return &expand_path($MknmzIncludeFile); +} + +sub mknmz_ignore_folders_regex() { + return $MknmzIgnoreFoldersRegex; +} + sub namazu_lock_dir() { return $NamazuLockDir; } @@ -1055,12 +1087,14 @@ ContextFile=Context # relative to ~/.im/ # folders Src=$InboxFolder # default source of most commands Imclean.Src=$TrashFolder # default source for message cleanups +Immknmz.Src= # folders specified by Mail/.folders are used #Imget.dst=$InboxFolder # default inbox folder Imrm.dst=$TrashFolder # default trash folder # mail address aliases for imali/imput AddrBookFile=Addrbook # relative to ~/.im/ AliasesFile=Aliases # relative to ~/.im/ #PetnameFile=Petnames # relative to ~/.im/ +MailFoldersFile=~/Mail/.folders UseTouchFile=off TouchFile=.mew-touch # imget/imls @@ -1077,6 +1111,7 @@ NntpServers=localhost # default server for NNTP # imput FccDir=$MailDir QueueDir=queue # relative to ~/.im/ +UseXDispatcher=on # use X-Dispatcher field # imget Imget.Src=local # default source of imget (local mailbox) PopHistory=pophist-{POPSERVERID} # to save last state (relative to ~/.im/) @@ -1085,7 +1120,10 @@ NntpHistory=newshist # to save last state (relative to ~/.im/) PwAgentTmpDir=pwagtmp # temporary directory (relative to ~/.im/) # namazu NamazuV2=off # use Namazu version 2 (1.9.x or late) +NamazuDir=Namazu # relative to ~/ NamazuLockDir=nmzlock # lock directory (relative to ~/.im/) +MknmzIncludeFile=~/Namazu/mknmz-inc.pl # mknmz -I <file> +MknmzIgnoreFoldersRegex=\+(attach|draft|trash|queue|postq|schedule) __END__ =head1 NAME @@ -1108,7 +1146,7 @@ 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 use_cl no_sync fsync_no preferred_fsync_no -addrbook_file aliases_file petname_file +addrbook_file aliases_file petname_file mail_folders_file context_file getchksbr_file getsbr_file scansbr_file scan_header_pick address addresses_regex msgdbfile msgdbtype @@ -1116,7 +1154,9 @@ mbox_style nntpservers nntphistoryfile nntpauthuser set_nntpauthuser popaccount pophistoryfile imapaccount httpproxy noproxy usepwagent pwagentport pwagent_tmp_dir pwagent_tmp_path usepwfiles pwfiles -expand_path usetouchfile touchfile namazuv2 namazu_lock_dir namazu_lock_path +expand_path use_xdispatcher usetouchfile touchfile +namazuv2 namazu_dir namazu_path namazu_lock_dir namazu_lock_path +mknmz_include_file mknmz_ignore_folders_regex pop_timeout imap_timeout nntp_timeout dns_timeout connect_timeout command_timeout rcv_buf_siz db_type file_attr ssh_path diff --git a/img/lib/IM/EncDec.pm b/img/lib/IM/EncDec.pm index 713a638a..eb39ae46 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::EncDec.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::EncDec.pm version 20030601(IM145)"; package IM::EncDec; require 5.003; diff --git a/img/lib/IM/File.pm b/img/lib/IM/File.pm index 9ffb7fb9..3f94b509 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::File.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::File.pm version 20030601(IM145)"; package IM::File; require 5.003; diff --git a/img/lib/IM/Folder.pm b/img/lib/IM/Folder.pm index c8566742..1f85d6d0 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Folder.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Folder.pm version 20030601(IM145)"; package IM::Folder; require 5.003; @@ -270,8 +270,10 @@ sub create_folder($) { next; } $p .= "/$subdir"; - $p =~ /(.+)/; # $p may be tainted - $p = $1; # clean up + if ($> != 0) { + $p =~ /(.+)/; # may be tainted + $p = $1; # clean up + } unless (-d $p) { # im_debug("Creating directory: $p\n") # if (&debug('folder')); diff --git a/img/lib/IM/GetPass.pm b/img/lib/IM/GetPass.pm index 050b2470..b1723959 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::GetPass.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::GetPass.pm version 20030601(IM145)"; package IM::GetPass; require 5.003; diff --git a/img/lib/IM/Grep.pm b/img/lib/IM/Grep.pm index aadaecda..c3ca599f 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Grep.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Grep.pm version 20030601(IM145)"; package IM::Grep; require 5.003; diff --git a/img/lib/IM/History.pm b/img/lib/IM/History.pm index 6ea54363..d4a074b8 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::History.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::History.pm version 20030601(IM145)"; package IM::History; require 5.003; diff --git a/img/lib/IM/Http.pm b/img/lib/IM/Http.pm index 5e63cfa9..0c21d881 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Http.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Http.pm version 20030601(IM145)"; package IM::Http; require 5.003; diff --git a/img/lib/IM/Imap.pm b/img/lib/IM/Imap.pm index 533ab42b..5ccf4810 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Imap.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Imap.pm version 20030601(IM145)"; package IM::Imap; require 5.003; diff --git a/img/lib/IM/Iso2022jp.pm b/img/lib/IM/Iso2022jp.pm index 56e97ac3..792ab822 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Iso2022jp.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Iso2022jp.pm version 20030601(IM145)"; package IM::Iso2022jp; require 5.003; diff --git a/img/lib/IM/Japanese.pm b/img/lib/IM/Japanese.pm index 165dae76..bc39bf78 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Japanese.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Japanese.pm version 20030601(IM145)"; package IM::Japanese; require 5.003; diff --git a/img/lib/IM/LocalMbox.pm b/img/lib/IM/LocalMbox.pm index c260b43a..4f98fd76 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::LocalMbox.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::LocalMbox.pm version 20030601(IM145)"; package IM::LocalMbox; require 5.003; @@ -103,11 +103,13 @@ sub local_get_msg($$$$$) { $getchk_hook = getchksbr_file(); if ($getchk_hook) { - if ($getchk_hook =~ /^(\S+)$/) { + if ($getchk_hook =~ /(.+)/) { if ($main::INSECURE) { im_warn("Sorry, GetChkSbr is ignored for SUID root script.\n"); } else { - $getchk_hook = $1; # to pass through taint check + if ($> != 0) { + $getchk_hook = $1; # to pass through taint check + } if (-f $getchk_hook) { require $getchk_hook; } else { @@ -137,8 +139,10 @@ sub local_get_msg($$$$$) { return -1; } if ($how eq 'get' && $main::opt_keep == 0) { - $f =~ /(.+)/; # $f is tainted yet - $f = $1; # clean up + if ($> != 0) { + $f =~ /(.+)/; # may be tainted + $f = $1; # clean up + } unlink("$mbox/$f"); } $msgs++; @@ -281,7 +285,7 @@ sub process_maildir($$$$) { return -1; } foreach $f (sort {(-M $b) <=> (-M $a) || $a cmp $b} readdir(FLDR)) { - if ($f =~ /^\d+\.(\d+|\d+_\d+)\..+/ && -s "$dir/$f") { + if ($f =~ /^\d+\.[^.:\/]+\./ && -s "$dir/$f") { my $ret = process_file("$dir/$f", $dst, $how, $noscan); next if ($ret > 0); # skip by rule if ($ret < 0) { @@ -289,8 +293,12 @@ sub process_maildir($$$$) { return -1; } if ($how eq 'get' && $main::opt_keep == 0) { - $f =~ /(.+)/; # $f is tainted yet - $f = $1; # clean up + if ($> != 0) { + $dir =~ /(.+)/; # may be tainted + $dir = $1; # clean up + $f =~ /(.+)/; # may be tainted + $f = $1; # clean up + } unlink("$dir/$f"); } $msgs++; diff --git a/img/lib/IM/Log.pm b/img/lib/IM/Log.pm index fb2e479a..0a124c3f 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Log.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Log.pm version 20030601(IM145)"; package IM::Log; require 5.003; @@ -90,8 +90,10 @@ sub log_action($$$$;@) { } my $file = expand_path($main::Log_file); - return unless ($file =~ /^(\S+)$/); - $file = $1; # to pass through taint check + return unless ($file =~ /(.+)/); + if ($> != 0) { + $file = $1; # to pass through taint check + } &msg_mode(1); unless (im_open(\*HISTORY, ">>$file")) { im_warn("can't open history file: $file ($!)\n"); diff --git a/img/lib/IM/MD5.pm b/img/lib/IM/MD5.pm index 1cbc4599..34e2473e 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::MD5.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::MD5.pm version 20030601(IM145)"; package IM::MD5; require 5.003; diff --git a/img/lib/IM/Message.pm b/img/lib/IM/Message.pm index cc9dca80..f7847eff 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Message.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Message.pm version 20030601(IM145)"; package IM::Message; require 5.003; @@ -17,6 +17,7 @@ require Exporter; use IM::Util; use IM::Address qw(extract_addr replace_addr fetch_addr); use IM::Alias qw(alias_lookup hosts_completion); +use IM::Config qw(use_xdispatcher); use integer; use strict; use vars qw(@ISA @EXPORT); @@ -479,7 +480,9 @@ sub put_mimed_bcc(*$$$$$$) { print CHAN "Sender: $main::Sender_line$crlf"; } print CHAN "To: blind-copy-recipients:;$crlf"; - print CHAN "X-Dispatcher: $main::VERSION$crlf"; + if (use_xdispatcher()) { + print CHAN "X-Dispatcher: $main::VERSION$crlf"; + } if (($subj = &header_value($Header, 'Subject')) ne '') { print CHAN "Subject: Bcc: $subj$crlf"; } else { @@ -583,7 +586,9 @@ sub put_mimed_error_notify(*$$$$$$$$;$) { return -1 unless (print CHAN "To: $main::Sender_line$crlf"); print CHAN "From: Imput-Error-Report$crlf"; - print CHAN "X-Dispatcher: $main::VERSION$crlf"; + if (use_xdispatcher()) { + print CHAN "X-Dispatcher: $main::VERSION$crlf"; + } if (($subj = &header_value($Header, 'Subject')) ne '') { print CHAN "Subject: Returned message: $subj$crlf"; } else { diff --git a/img/lib/IM/MsgStore.pm b/img/lib/IM/MsgStore.pm index d1789803..614d7982 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::MsgStore.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::MsgStore.pm version 20030601(IM145)"; package IM::MsgStore; require 5.003; @@ -196,8 +196,10 @@ sub exec_getsbrfile($) { im_warn("Sorry, GetSbr is ignored for SUID root script\n"); return; } - if ($get_hook =~ /^(\S+)$/) { - $get_hook = $1; # to pass through taint check + if ($get_hook =~ /(.+)/) { + if ($> != 0) { + $get_hook = $1; # to pass through taint check + } if (-f $get_hook) { require $get_hook; } else { diff --git a/img/lib/IM/Nntp.pm b/img/lib/IM/Nntp.pm index 23b569ac..3778e12f 100644 --- a/img/lib/IM/Nntp.pm +++ b/img/lib/IM/Nntp.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Nntp.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Nntp.pm version 20030601(IM145)"; package IM::Nntp; require 5.003; diff --git a/img/lib/IM/Pop.pm b/img/lib/IM/Pop.pm index 9e8a5618..50b8e300 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Pop.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Pop.pm version 20030601(IM145)"; package IM::Pop; require 5.003; @@ -288,8 +288,10 @@ sub pop_process($$$$) { if ($histfile eq '') { im_err("POP historyfile $histfile undefined.\n"); return -1; - } elsif ($histfile =~ /(\S+)/) { - $histfile = $1; # to pass through taint check + } elsif ($histfile =~ /(.+)/) { + if ($> != 0) { + $histfile = $1; # to pass through taint check + } } else { im_err("invalid POP historyfile: $histfile.\n"); return -1; @@ -442,11 +444,13 @@ sub pop_inc($$$$$$$$) { my $getchk_hook = getchksbr_file(); if ($getchk_hook) { - if ($getchk_hook =~ /^(\S+)$/) { + if ($getchk_hook =~ /(.+)/) { if ($main::INSECURE) { im_warn("Sorry, GetChkSbr is ignored for SUID root script.\n"); } else { - $getchk_hook = $1; # to pass through taint check + if ($> != 0) { + $getchk_hook = $1; # to pass through taint check + } if (-f $getchk_hook) { require $getchk_hook; } else { diff --git a/img/lib/IM/Recipient.pm b/img/lib/IM/Recipient.pm index e97c425e..917cd9a1 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Recipient.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Recipient.pm version 20030601(IM145)"; package IM::Recipient; require 5.003; diff --git a/img/lib/IM/Scan.pm b/img/lib/IM/Scan.pm index 07407f84..0a465a9f 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Scan.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Scan.pm version 20030601(IM145)"; package IM::Scan; require 5.003; @@ -121,11 +121,13 @@ sub set_scan_form($$$) { $JIS_SAFE= $jis_safe; my $scan_hook = scansbr_file(); - if ($scan_hook =~ /^(\S+)$/) { + if ($scan_hook =~ /(.+)/) { if ($main::INSECURE) { im_warn("Sorry, ScanSbr is ignored for SUID root script.\n"); } else { - $scan_hook = $1; # to pass through taint check + if ($> != 0) { + $scan_hook = $1; # to pass through taint check + } if (-f $scan_hook) { require $scan_hook; } else { @@ -262,15 +264,16 @@ sub parse_body(*$) { next if /^=2D/; next if /^\s+[\w*-]+=/; # eg. "boundary="; * = RFC2231 next if /^\s*[\w-]+: /; # Headers and header style citation - next if /^\s*[>:|\/_}]/; # other citation - next if /^ /; + next if /^\s*[>:|\#;\/_}]/; + next if /^\s*[[<\/(.]+ *snip/; + next if /^ /; next if /^\s*\w+([\'._-]+\w+)*>/; next if /^\s*(On|At) .*[^.!\s\n]\s*$/; - next if /(:|;|\/)\s*\n$/; - next if /(wrote|writes?|said|says?)[^.!\n]?\s*\n$/; + next if /(:|;|\/)\s*\n$/; + next if /(wrote|writes?|said|says?)[^.!\n]?\s*\n$/; next if /^This is a multi-part message in MIME format/i; - if (/^\s*In (message|article|<|\")/i) { + if (/^\s*In (message|article|mail|news|<|\"|\[|\()/i) { if ($mode == 0) { $_ = <HANDLE>; } else { @@ -536,10 +539,10 @@ sub my_addr(@) { unless (defined($ADDRESS_HASH{'init'})) { $ADDRESS_HASH{'addr'} = addresses_regex(); unless ($ADDRESS_HASH{'addr'}) { - $ADDRESS_HASH{'addr'} = '^' . quotemeta(address()) . '$'; #' - $ADDRESS_HASH{'addr'} =~ s/(\\\s)*\\,(\\\s)*/\$|\^/g; + $ADDRESS_HASH{'addr'} = '^' . quotemeta(address()) . "\$"; + $ADDRESS_HASH{'addr'} =~ s/(\\\s)*\\,(\\\s)*/\$|\^/g; } - $ADDRESS_HASH{'init'} = 1; + $ADDRESS_HASH{'init'} = 1; } return 0 if ($ADDRESS_HASH{'addr'} eq ""); foreach $addr (@addrs) { diff --git a/img/lib/IM/Smtp.pm b/img/lib/IM/Smtp.pm index 1826cf02..5b9421ca 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Smtp.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Smtp.pm version 20030601(IM145)"; package IM::Smtp; require 5.003; diff --git a/img/lib/IM/Ssh.pm b/img/lib/IM/Ssh.pm index cbdbb3c6..b997992d 100644 --- a/img/lib/IM/Ssh.pm +++ b/img/lib/IM/Ssh.pm @@ -6,10 +6,10 @@ ### Author: Masatoshi Tsuchiya <tsuchiya@pine.kuee.kyoto-u.ac.jp> ### Internet Message Group <img@mew.org> ### Created: Oct 05, 1999 -### Revised: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Ssh.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Ssh.pm version 20030601(IM145)"; package IM::Ssh; require 5.003; diff --git a/img/lib/IM/Stdio.pm b/img/lib/IM/Stdio.pm index 645f1c0d..bae416ea 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Stdio.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Stdio.pm version 20030601(IM145)"; package IM::Stdio; require 5.003; diff --git a/img/lib/IM/TcpTransaction.pm b/img/lib/IM/TcpTransaction.pm index b0ee4b32..051cfc73 100644 --- a/img/lib/IM/TcpTransaction.pm +++ b/img/lib/IM/TcpTransaction.pm @@ -5,10 +5,10 @@ ### ### Author: Internet Message Group <img@mew.org> ### Created: Apr 23, 1997 -### Revised: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::TcpTransaction.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::TcpTransaction.pm version 20030601(IM145)"; package IM::TcpTransaction; require 5.003; diff --git a/img/lib/IM/Util.pm b/img/lib/IM/Util.pm index 90c98b89..1591eacd 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: Mar 22, 2003 +### Revised: Jun 1, 2003 ### -my $PM_VERSION = "IM::Util.pm version 20030322(IM144)"; +my $PM_VERSION = "IM::Util.pm version 20030601(IM145)"; package IM::Util; require 5.003; @@ -262,9 +262,13 @@ sub flush(*) { # sub im_open($$) { - my($d, $a) = @_; + my($d, $f) = @_; my($r); - if ($r = open($d, $a)) { + if ($> != 0) { + $f =~ /(.+)/; # may be tainted + $f = $1; # clean up + } + if ($r = open($d, $f)) { binmode($d); } return $r; @@ -273,6 +277,10 @@ sub im_open($$) { sub im_sysopen($$$) { my($d, $f, $a) = @_; my($r); + if ($> != 0) { + $f =~ /(.+)/; # may be tainted + $f = $1; # clean up + } if ($r = sysopen($d, $f, $a)) { binmode($d); } |
