summaryrefslogtreecommitdiff
path: root/fml
diff options
context:
space:
mode:
authorfukachan <fukachan>2006-01-13 00:17:08 +0000
committerfukachan <fukachan>2006-01-13 00:17:08 +0000
commite84177d180e7fe481ca3708e28d40eabcd1e8739 (patch)
tree9b7aa9874c88388f9dd00af5a770c49579af5e16 /fml
parent5b7c66df5ad5d20d3f22d1241263def7c88da2cc (diff)
downloadfml8-e84177d180e7fe481ca3708e28d40eabcd1e8739.tar.gz
fml8-e84177d180e7fe481ca3708e28d40eabcd1e8739.tar.bz2
fml8-e84177d180e7fe481ca3708e28d40eabcd1e8739.zip
is_config_cf_exist() evals the statements.
implement is_fml8_managed_address() which checks the given address is either of fml8 managed ml addresses.
Diffstat (limited to 'fml')
-rw-r--r--fml/lib/FML/Process/Utils.pm34
1 files changed, 31 insertions, 3 deletions
diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm
index 60b64df3..115df9ec 100644
--- a/fml/lib/FML/Process/Utils.pm
+++ b/fml/lib/FML/Process/Utils.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: Utils.pm,v 1.143 2005/12/18 11:53:26 fukachan Exp $
+# $FML: Utils.pm,v 1.144 2006/01/09 14:00:54 fukachan Exp $
#
package FML::Process::Utils;
@@ -1398,9 +1398,15 @@ sub config_cf_filepath
sub is_config_cf_exist
{
my ($curproc, $ml, $domain) = @_;
- my $f = $curproc->config_cf_filepath($ml, $domain);
+ my $status = 0;
- return ( -f $f ? 1 : 0 );
+ eval {
+ my $f = $curproc->config_cf_filepath($ml, $domain);
+ $status = ( -f $f ? 1 : 0 );
+ };
+ if ($@) { return 0;}
+
+ return $status;
}
@@ -1588,6 +1594,28 @@ sub is_allow_reply_message
}
+=head2 is_fml8_managed_address($address)
+
+check if $address is one of valid ml address fml8 on this host
+manages.
+
+=cut
+
+
+# Descriptions: check if $address is one of valid ml address fml8 on
+# this host manages.
+# Arguments: OBJ($curproc) STR($address)
+# Side Effects: none
+# Return Value: NUM(0 or 1)
+sub is_fml8_managed_address
+{
+ my ($curproc, $address) = @_;
+ my ($ml_name, $ml_domain) = split(/\@/, $address);
+
+ return $curproc->is_config_cf_exist($ml_name, $ml_domain);
+}
+
+
=head2 map_to_term($map)
which this $map belongs to ?