diff options
| author | fukachan <fukachan> | 2008-09-09 09:47:57 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2008-09-09 09:47:57 +0000 |
| commit | 6949d178e54d895a37cc39bff9126e871bb86694 (patch) | |
| tree | a1eb144350090612d82dd82159f02f3b74848d90 /fml/lib/FML/Process | |
| parent | 453db284ee46f8c24e2d28a6ad493d1175535b1f (diff) | |
| download | fml8-6949d178e54d895a37cc39bff9126e871bb86694.tar.gz fml8-6949d178e54d895a37cc39bff9126e871bb86694.tar.bz2 fml8-6949d178e54d895a37cc39bff9126e871bb86694.zip | |
fix how to search main_cf information.
define set_allow_reply_message() and get_allow_reply_message().
We can enable or disable reply_message*() functions dynamically.
Diffstat (limited to 'fml/lib/FML/Process')
| -rw-r--r-- | fml/lib/FML/Process/Utils.pm | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/fml/lib/FML/Process/Utils.pm b/fml/lib/FML/Process/Utils.pm index 09f4650c..b8547e57 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.151 2006/07/09 12:11:13 fukachan Exp $ +# $FML: Utils.pm,v 1.152 2008/07/20 00:38:53 fukachan Exp $ # package FML::Process::Utils; @@ -1389,7 +1389,8 @@ return $ml_home_prefix in main.cf. sub ml_home_prefix { my ($curproc, $domain) = @_; - my $main_cf = $curproc->{ __parent_args }->{ main_cf }; + my $main_cf = + $curproc->{ __parent_args }->{ main_cf } || $curproc->{ main_cf }; $curproc->__ml_home_prefix_from_main_cf($main_cf, $domain); } @@ -1739,7 +1740,10 @@ sub is_allow_reply_message my $option = $curproc->command_line_options(); my $myname = $curproc->myname(); - if ($curproc->is_under_mta_process()) { + if ($curproc->_is_allow_reply_message()) { + return 1; + } + elsif ($curproc->is_under_mta_process()) { return 1; } elsif (defined $option->{ 'allow-reply-message' }) { @@ -1756,6 +1760,42 @@ sub is_allow_reply_message } +# Descriptions: enable that reply_message*() functions work. +# Arguments: OBJ($curproc) +# Side Effects: update PCB. +# Return Value: none +sub set_allow_reply_message +{ + my ($curproc) = @_; + my ($pcb) = $curproc->pcb(); + + $pcb->set("reply_message", "allow", 1); +} + + +# Descriptions: check if that reply_message*() functions work. +# Arguments: OBJ($curproc) +# Side Effects: none +# Return Value: NUM(1 or 0) +sub get_allow_reply_message +{ + my ($curproc) = @_; + my ($pcb) = $curproc->pcb(); + $pcb->get("reply_message", "allow") ? 1 : 0; +} + + +# Descriptions: check if that reply_message*() functions work. +# Arguments: OBJ($curproc) +# Side Effects: none +# Return Value: NUM(1 or 0) +sub _is_allow_reply_message +{ + my ($curproc) = @_; + $curproc->get_allow_reply_message(); +} + + =head2 is_fml8_managed_address($address) check if $address is one of valid ml address fml8 on this host |
