summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-04-19 11:41:03 +0000
committerfukachan <fukachan>2003-04-19 11:41:03 +0000
commitca35b400df62289c2568f89d3a75168636b003d7 (patch)
treead4a2b96522311542bc66911e32533fcfaadc76e
parent0c58368f2f6a719185ad23bb168b19fad45fe351 (diff)
downloadfml8-ca35b400df62289c2568f89d3a75168636b003d7.tar.gz
fml8-ca35b400df62289c2568f89d3a75168636b003d7.tar.bz2
fml8-ca35b400df62289c2568f89d3a75168636b003d7.zip
we should handle addresses used by fml such as elena@fml.org,
elena-ctl@fml.org et.al. exceptionally in handling errors.
-rw-r--r--fml/etc/default_config.cf.ja.in12
-rw-r--r--fml/etc/src/config.cf.ja/acl.cf12
-rw-r--r--fml/lib/FML/Error.pm55
3 files changed, 70 insertions, 9 deletions
diff --git a/fml/etc/default_config.cf.ja.in b/fml/etc/default_config.cf.ja.in
index ea952ca4..c04ab6c0 100644
--- a/fml/etc/default_config.cf.ja.in
+++ b/fml/etc/default_config.cf.ja.in
@@ -465,6 +465,18 @@ system_accounts = root
\S+\-subscribe
\S+\-unsubscribe
+
+
+# Descriptions: MLが使うアドレス: 例: elena, elena-ctl
+# たとえば、libexec/error は、これらのアドレスを
+# 削除しちゃいけない。
+# History: none
+# Value: a list of strings
+# Examples: (elena-ctl@fml.org elena-ctl@fml.org ...)
+list_addresses = $address_for_post
+ $address_for_command
+ $maintainer
+
=head1 MTA の設定
=head2 SMTP パラメータ
diff --git a/fml/etc/src/config.cf.ja/acl.cf b/fml/etc/src/config.cf.ja/acl.cf
index 4f330d7a..869e70b9 100644
--- a/fml/etc/src/config.cf.ja/acl.cf
+++ b/fml/etc/src/config.cf.ja/acl.cf
@@ -228,3 +228,15 @@ system_accounts = root
\S+\-help
\S+\-subscribe
\S+\-unsubscribe
+
+
+
+# Descriptions: MLが使うアドレス: 例: elena, elena-ctl
+# たとえば、libexec/error は、これらのアドレスを
+# 削除しちゃいけない。
+# History: none
+# Value: a list of strings
+# Examples: (elena-ctl@fml.org elena-ctl@fml.org ...)
+list_addresses = $address_for_post
+ $address_for_command
+ $maintainer
diff --git a/fml/lib/FML/Error.pm b/fml/lib/FML/Error.pm
index ad380910..1df5c568 100644
--- a/fml/lib/FML/Error.pm
+++ b/fml/lib/FML/Error.pm
@@ -4,7 +4,7 @@
# All rights reserved. This program is free software; you can
# redistribute it and/or modify it under the same terms as Perl itself.
#
-# $FML: Error.pm,v 1.17 2003/03/16 10:47:10 fukachan Exp $
+# $FML: Error.pm,v 1.18 2003/03/28 10:32:20 fukachan Exp $
#
package FML::Error;
@@ -14,7 +14,7 @@ use Carp;
use FML::Log qw(Log LogWarn LogError);
-my $debug = 1;
+my $debug = 0;
=head1 NAME
@@ -219,6 +219,37 @@ sub get_data_detail
}
+# Descriptions: check whether $addr is one of addresses this ML uses.
+# Arguments: OBJ($self) STR($addr)
+# Side Effects: none
+# Return Value: NUM
+sub is_list_address
+{
+ my ($self, $addr) = @_;
+ my $curproc = $self->{ _curproc };
+ my $config = $curproc->config();
+ my $addrs = $config->get_as_array_ref('list_addresses');
+ my $match = 0;
+
+ use FML::Credential;
+ my $cred = new FML::Credential $curproc;
+ $cred->set_compare_level(100); # match strictly!
+ for my $sysaddr (@$addrs) {
+ if (defined $sysaddr && $sysaddr) {
+ Log("check is_same_address($addr, $sysaddr)") if $debug;
+ if ($cred->is_same_address($addr, $sysaddr)) {
+ Log("match") if $debug;
+ $match++;
+ }
+ else {
+ Log("not match") if $debug;
+ }
+ }
+ }
+
+ return $match;
+}
+
=head2 remove_bouncers()
delete mail addresses, analyze() determined as bouncers, by deluser()
@@ -249,18 +280,24 @@ sub remove_bouncers
# XXX need no lock here since lock is done in FML::Command::* class.
ADDR:
for my $addr (@$list) {
- # check if $address is a safe string.
- if ($safe->regexp_match('address', $addr)) {
- if ($cred->is_member( $addr ) || $cred->is_recipient( $addr )) {
- $self->deluser( $addr );
+ unless ($self->is_list_address($addr)) {
+ # check if $address is a safe string.
+ if ($safe->regexp_match('address', $addr)) {
+ if ($cred->is_member( $addr ) ||
+ $cred->is_recipient( $addr )) {
+ $self->deluser( $addr );
+ }
+ else {
+ Log("remove_bouncers: <$addr> seems not member");
+ }
}
else {
- Log("remove_bouncers: <$addr> seems not member");
+ LogError("remove_bouncers: <$addr> is invalid");
+ next ADDR;
}
}
else {
- LogError("remove_bouncers: <$addr> is invalid");
- next ADDR;
+ LogWarn("remove_bouncers: <$addr> ignored");
}
}
}