summaryrefslogtreecommitdiff
path: root/img/lib
diff options
context:
space:
mode:
authorfukachan <fukachan>2004-07-18 16:13:44 +0000
committerfukachan <fukachan>2004-07-18 16:13:44 +0000
commitddc1ed19d3f9d8d8840bea932174a68749550330 (patch)
tree49a45abac9e6523c1e8c58593c87cb1d6276373c /img/lib
parente0599b089f1827abfc80f8ab9de549223337f4d9 (diff)
downloadfml8-im-147.tar.gz
fml8-im-147.tar.bz2
fml8-im-147.zip
im-147im-147
Diffstat (limited to 'img/lib')
-rw-r--r--img/lib/IM/Address.pm2
-rw-r--r--img/lib/IM/Alias.pm2
-rw-r--r--img/lib/IM/Config.pm.in13
-rw-r--r--img/lib/IM/EncDec.pm2
-rw-r--r--img/lib/IM/File.pm2
-rw-r--r--img/lib/IM/Folder.pm2
-rw-r--r--img/lib/IM/GetPass.pm2
-rw-r--r--img/lib/IM/Grep.pm2
-rw-r--r--img/lib/IM/History.pm2
-rw-r--r--img/lib/IM/Http.pm2
-rw-r--r--img/lib/IM/Imap.pm8
-rw-r--r--img/lib/IM/Iso2022jp.pm2
-rw-r--r--img/lib/IM/Japanese.pm2
-rw-r--r--img/lib/IM/LocalMbox.pm52
-rw-r--r--img/lib/IM/Log.pm2
-rw-r--r--img/lib/IM/MD5.pm2
-rw-r--r--img/lib/IM/Message.pm10
-rw-r--r--img/lib/IM/MsgStore.pm2
-rw-r--r--img/lib/IM/Nntp.pm2
-rw-r--r--img/lib/IM/Pop.pm2
-rw-r--r--img/lib/IM/Recipient.pm2
-rw-r--r--img/lib/IM/Scan.pm2
-rw-r--r--img/lib/IM/Smtp.pm2
-rw-r--r--img/lib/IM/Ssh.pm2
-rw-r--r--img/lib/IM/Stdio.pm2
-rw-r--r--img/lib/IM/TcpTransaction.pm2
-rw-r--r--img/lib/IM/Util.pm2
27 files changed, 76 insertions, 53 deletions
diff --git a/img/lib/IM/Address.pm b/img/lib/IM/Address.pm
index 06524365..b6e309e4 100644
--- a/img/lib/IM/Address.pm
+++ b/img/lib/IM/Address.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Address.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Alias.pm b/img/lib/IM/Alias.pm
index f8725e20..6b04634a 100644
--- a/img/lib/IM/Alias.pm
+++ b/img/lib/IM/Alias.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Alias.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Config.pm.in b/img/lib/IM/Config.pm.in
index 4e2f8507..10f55106 100644
--- a/img/lib/IM/Config.pm.in
+++ b/img/lib/IM/Config.pm.in
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Config.pm version 20031028(IM146)";
@@ -37,7 +37,7 @@ use vars qw(@ISA @EXPORT);
context_file getchksbr_file getsbr_file scansbr_file scan_header_pick
address addresses_regex
msgdbfile msgdbtype
- mbox_style
+ mbox_style mbox_filter
nntpservers nntphistoryfile nntpauthuser set_nntpauthuser
popaccount pophistoryfile imapaccount httpproxy noproxy
usepwagent pwagentport pwagent_tmp_dir pwagent_tmp_path usepwfiles pwfiles
@@ -127,7 +127,8 @@ BEGIN {
'getsbr;s;;GetSbrFile' => 'Get hook subroutine script',
'scansbr;s;;ScanSbrFile' => 'Scan hook subroutine script',
'scanheaderpick;s;;ScanHeaderPick' => 'Scan headers to pick up',
- 'mboxstyle;s;;MBoxStyle' => 'Style of local MBox format',
+ 'mboxstyle;s;;MBoxStyle' => 'Style of local mailbox format',
+ 'mboxfilter;s;;MboxFilter' => 'Filter for mbox file',
'nntpservers;s;;NNTPservers' => 'List of NNTP servers',
'nntphistory;s;;NNTPhistory' => 'Status file of NNTP access',
'nntpauthuser;s;;NNTPauthuser' => 'User name for NNTP authentication',
@@ -873,6 +874,10 @@ sub mbox_style() {
return $MBoxStyle;
}
+sub mbox_filter() {
+ return $MboxFilter;
+}
+
sub nntpservers() {
return $NNTPservers;
}
@@ -1150,7 +1155,7 @@ 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
-mbox_style
+mbox_style mbox_filter
nntpservers nntphistoryfile nntpauthuser set_nntpauthuser
popaccount pophistoryfile imapaccount httpproxy noproxy
usepwagent pwagentport pwagent_tmp_dir pwagent_tmp_path usepwfiles pwfiles
diff --git a/img/lib/IM/EncDec.pm b/img/lib/IM/EncDec.pm
index c01433a0..ac4560a6 100644
--- a/img/lib/IM/EncDec.pm
+++ b/img/lib/IM/EncDec.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::EncDec.pm version 20031028(IM146)";
diff --git a/img/lib/IM/File.pm b/img/lib/IM/File.pm
index 384c4434..c7bfd00d 100644
--- a/img/lib/IM/File.pm
+++ b/img/lib/IM/File.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Jul 7, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::File.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Folder.pm b/img/lib/IM/Folder.pm
index 9f3a746f..b55a220b 100644
--- a/img/lib/IM/Folder.pm
+++ b/img/lib/IM/Folder.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Folder.pm version 20031028(IM146)";
diff --git a/img/lib/IM/GetPass.pm b/img/lib/IM/GetPass.pm
index 662577ec..7f2df60c 100644
--- a/img/lib/IM/GetPass.pm
+++ b/img/lib/IM/GetPass.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 30, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::GetPass.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Grep.pm b/img/lib/IM/Grep.pm
index 72da001f..072f80b1 100644
--- a/img/lib/IM/Grep.pm
+++ b/img/lib/IM/Grep.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Nov 03, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Grep.pm version 20031028(IM146)";
diff --git a/img/lib/IM/History.pm b/img/lib/IM/History.pm
index 13eb2b27..84586902 100644
--- a/img/lib/IM/History.pm
+++ b/img/lib/IM/History.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Jul 6, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::History.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Http.pm b/img/lib/IM/Http.pm
index 4686bf55..af619bee 100644
--- a/img/lib/IM/Http.pm
+++ b/img/lib/IM/Http.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Http.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Imap.pm b/img/lib/IM/Imap.pm
index 941c1583..5ceedfce 100644
--- a/img/lib/IM/Imap.pm
+++ b/img/lib/IM/Imap.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Imap.pm version 20031028(IM146)";
@@ -157,10 +157,10 @@ sub imap_select($$$) {
my($seq) = $ImapSeq++;
my($resp, @field);
if ($select) {
- im_notice("select mbox $mbox and getting number of message.\n");
+ im_notice("select mailbox $mbox and getting number of message.\n");
$resp = &send_command($HANDLE, "im$seq SELECT $mbox", '');
} else {
- im_notice("examine mbox $mbox and getting number of message.\n");
+ im_notice("examine mailbox $mbox and getting number of message.\n");
$resp = &send_command($HANDLE, "im$seq EXAMINE $mbox", '');
}
my $msgs = -1;
@@ -584,7 +584,7 @@ sub imap_get_msg($$$$$) {
}
}
-# IMAP folder (--src=imap[%folder][//auth][:user][@server[/port]])
+# IMAP folder (--src=imap[/auth|%folder[//auth]][:user][@server[/port]])
sub imap_spec($) {
my $spec = shift;
diff --git a/img/lib/IM/Iso2022jp.pm b/img/lib/IM/Iso2022jp.pm
index e6992a5e..d5583302 100644
--- a/img/lib/IM/Iso2022jp.pm
+++ b/img/lib/IM/Iso2022jp.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Iso2022jp.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Japanese.pm b/img/lib/IM/Japanese.pm
index 84055d5f..67cd4ab8 100644
--- a/img/lib/IM/Japanese.pm
+++ b/img/lib/IM/Japanese.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Japanese.pm version 20031028(IM146)";
diff --git a/img/lib/IM/LocalMbox.pm b/img/lib/IM/LocalMbox.pm
index 70b80e13..598e8d72 100644
--- a/img/lib/IM/LocalMbox.pm
+++ b/img/lib/IM/LocalMbox.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::LocalMbox.pm version 20031028(IM146)";
@@ -314,7 +314,7 @@ sub process_file($$$$) {
my($format, $msgs, $rp, $length, $inheader, @Message);
local(*MBOX);
- im_notice("opening MBOX ($mbox)\n");
+ im_notice("opening file ($mbox)\n");
unless (im_open(\*MBOX, "<$mbox")) {
# XXX not found or unreadable...
return -1;
@@ -346,13 +346,37 @@ sub process_mbox($$$$$) {
my($format, $msgs, $length, $inheader, @Message);
local(*MBOX);
my($first_line, $FIRST_LINE);
+ my($mbox_filter);
- im_info("Getting new messages from local mailbox into $dst...\n")
- if ($how eq 'get');
- im_warn("opening MBOX ($mbox)\n") if (&verbose);
- unless (im_open(\*MBOX, "<$mbox")) {
- # XXX not found or unreadable...
- return -1;
+ if ($how eq 'get') {
+ im_info("Getting new messages from local mailbox into $dst...\n");
+ }
+ $mbox_filter = &mbox_filter();
+ if ($mbox_filter ne '') {
+ if ($mbox_filter =~ /(.+)/) {
+ if ($main::INSECURE) {
+ im_warn("Sorry, MboxFilter is ignored for SUID root script.\n");
+ $mbox_filter = '';
+ } else {
+ if ($> != 0) {
+ $mbox_filter = $1; # to pass through taint check
+ }
+ im_warn("opening MBOX ($mbox_filter $mbox)\n") if (&verbose);
+ unless (im_open(\*MBOX, "$mbox_filter $mbox |")) {
+ im_err("MboxFilter failed ($!).\n");
+ return -1;
+ }
+ }
+ } else {
+ $mbox_filter = '';
+ }
+ }
+ if ($mbox_filter eq '') {
+ im_warn("opening MBOX ($mbox)\n") if (&verbose);
+ unless (im_open(\*MBOX, "<$mbox")) {
+ # XXX not found or unreadable...
+ return -1;
+ }
}
chomp($first_line = <MBOX>);
if ($first_line =~ /^From /) {
@@ -547,7 +571,7 @@ sub local_lockmbox($$) {
if ($type =~ /file/) {
# while (!sysopen(LOCK, "$base.lock", O_RDWR()|O_CREAT()|O_EXCL())) {
# if ($retry >= 10) {
-# im_warn("can't create $base.lock: $!\n");
+# im_warn("can't create $base.lock ($!).\n");
# return -1;
# }
# im_warn("mailbox is processed by another process, waiting...\n")
@@ -557,7 +581,7 @@ sub local_lockmbox($$) {
# }
unless (im_open(\*LOCKFILE, ">$base.$$")) {
- im_warn("can't create lock file $base.$$: $!\n");
+ im_warn("can't create lock file $base.$$ ($!).\n");
im_warn("use 'flock' instead of 'file' if possible.\n");
return -1;
}
@@ -565,7 +589,7 @@ sub local_lockmbox($$) {
close(LOCKFILE);
while (!link("$base.$$", "$base.lock")) {
if ($retry >= 10) {
- im_warn("can't create $base.lock: $!\n");
+ im_warn("can't create $base.lock ($!).\n");
unlink("$base.$$");
return -1;
}
@@ -579,12 +603,12 @@ sub local_lockmbox($$) {
}
if ($type =~ /flock/) {
unless (im_open(\*LOCK_FH, "+<$base")) {
- im_err "can't open $base :$!\n";
+ im_err "can't open $base ($!).\n";
return -1;
}
if (! &win95p) {
unless (flock (LOCK_FH, LOCK_EX|LOCK_NB)) {
- im_warn "can't flock $base: $!\n";
+ im_warn "can't flock $base ($!).\n";
return -1;
}
}
@@ -599,7 +623,7 @@ sub local_unlockmbox($) {
im_debug("removing lock file with uid=$> gid=$)\n") if (&debug('local'));
if ($locked_by_file) {
if (-f "$base.lock" && unlink("$base.lock") <= 0) {
- im_warn("can't unlink lock file $base.lock: $!\n");
+ im_warn("can't unlink lock file $base.lock ($!).\n");
$rcode = -1;
}
$locked_by_file = 0;
diff --git a/img/lib/IM/Log.pm b/img/lib/IM/Log.pm
index b45f4d21..5c3b6ffa 100644
--- a/img/lib/IM/Log.pm
+++ b/img/lib/IM/Log.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Log.pm version 20031028(IM146)";
diff --git a/img/lib/IM/MD5.pm b/img/lib/IM/MD5.pm
index d7d3d8cc..5817992f 100644
--- a/img/lib/IM/MD5.pm
+++ b/img/lib/IM/MD5.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::MD5.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Message.pm b/img/lib/IM/Message.pm
index cbfbf544..38eb2d10 100644
--- a/img/lib/IM/Message.pm
+++ b/img/lib/IM/Message.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Message.pm version 20031028(IM146)";
@@ -735,14 +735,8 @@ sub gen_message_id($) {
if ($main::Message_id_PID) {
$mid_rnd = "-".$$.$mid_rnd;
}
- my $mid_user;
- if ($main::Message_id_UID) {
- $mid_user = $<;
- } else {
- $mid_user = $main::Login;
- }
my($mid)
- = "<$mid_time$mid_rnd.$mid_user\@$main::Message_id_domain_name>";
+ = "<$mid_time$mid_rnd.$main::Message_id_user_name\@$main::Message_id_domain_name>";
$Mid_hist{$part} = $mid if ($part > 0);
return $mid;
}
diff --git a/img/lib/IM/MsgStore.pm b/img/lib/IM/MsgStore.pm
index 939ffbea..49aa728e 100644
--- a/img/lib/IM/MsgStore.pm
+++ b/img/lib/IM/MsgStore.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::MsgStore.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Nntp.pm b/img/lib/IM/Nntp.pm
index 87bfea19..94a82cc9 100644
--- a/img/lib/IM/Nntp.pm
+++ b/img/lib/IM/Nntp.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Nntp.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Pop.pm b/img/lib/IM/Pop.pm
index 0892a2ab..c321f1ac 100644
--- a/img/lib/IM/Pop.pm
+++ b/img/lib/IM/Pop.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Pop.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Recipient.pm b/img/lib/IM/Recipient.pm
index 583d7016..2ad56275 100644
--- a/img/lib/IM/Recipient.pm
+++ b/img/lib/IM/Recipient.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 27, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Recipient.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Scan.pm b/img/lib/IM/Scan.pm
index deb2dbd9..5cc2ca2e 100644
--- a/img/lib/IM/Scan.pm
+++ b/img/lib/IM/Scan.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Scan.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Smtp.pm b/img/lib/IM/Smtp.pm
index 2839b5c1..0478e9a5 100644
--- a/img/lib/IM/Smtp.pm
+++ b/img/lib/IM/Smtp.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Smtp.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Ssh.pm b/img/lib/IM/Ssh.pm
index cc411d11..f430e266 100644
--- a/img/lib/IM/Ssh.pm
+++ b/img/lib/IM/Ssh.pm
@@ -6,7 +6,7 @@
### Author: Masatoshi Tsuchiya <tsuchiya@pine.kuee.kyoto-u.ac.jp>
### Internet Message Group <img@mew.org>
### Created: Oct 05, 1999
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Ssh.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Stdio.pm b/img/lib/IM/Stdio.pm
index 6b7be57f..05dab79c 100644
--- a/img/lib/IM/Stdio.pm
+++ b/img/lib/IM/Stdio.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: May 7, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Stdio.pm version 20031028(IM146)";
diff --git a/img/lib/IM/TcpTransaction.pm b/img/lib/IM/TcpTransaction.pm
index 0579ac29..06f16178 100644
--- a/img/lib/IM/TcpTransaction.pm
+++ b/img/lib/IM/TcpTransaction.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::TcpTransaction.pm version 20031028(IM146)";
diff --git a/img/lib/IM/Util.pm b/img/lib/IM/Util.pm
index 516a88a2..03d9521e 100644
--- a/img/lib/IM/Util.pm
+++ b/img/lib/IM/Util.pm
@@ -5,7 +5,7 @@
###
### Author: Internet Message Group <img@mew.org>
### Created: Apr 23, 1997
-### Revised: Oct 28, 2003
+### Revised: Jul 4, 2004
###
my $PM_VERSION = "IM::Util.pm version 20031028(IM146)";