diff options
| author | fukachan <fukachan> | 2003-05-13 09:30:09 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-05-13 09:30:09 +0000 |
| commit | 38758e30bce59cc88ab714fc88c2dc8459dd08c4 (patch) | |
| tree | 2bb94f56865d149d4f6c373ff69f64816902989f | |
| parent | 57a55fa9ff12621e054c6367e7112e84eb2089e4 (diff) | |
| download | fml8-38758e30bce59cc88ab714fc88c2dc8459dd08c4.tar.gz fml8-38758e30bce59cc88ab714fc88c2dc8459dd08c4.tar.bz2 fml8-38758e30bce59cc88ab714fc88c2dc8459dd08c4.zip | |
check the existence of path_* programs
| -rw-r--r-- | fml/lib/FML/MTAControl/Postfix.pm | 34 | ||||
| -rw-r--r-- | fml/lib/FML/MTAControl/Sendmail.pm | 17 |
2 files changed, 38 insertions, 13 deletions
diff --git a/fml/lib/FML/MTAControl/Postfix.pm b/fml/lib/FML/MTAControl/Postfix.pm index 9e55afe0..ccd52c40 100644 --- a/fml/lib/FML/MTAControl/Postfix.pm +++ b/fml/lib/FML/MTAControl/Postfix.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: Postfix.pm,v 1.18 2003/01/27 03:23:17 fukachan Exp $ +# $FML: Postfix.pm,v 1.19 2003/02/11 11:04:43 fukachan Exp $ # package FML::MTAControl::Postfix; @@ -134,7 +134,12 @@ sub postfix_update_alias my $alias = $config->{ mail_aliases_file }; print STDERR "updating $alias database\n"; - system "$prog $alias"; + if (-x $prog) { + system "$prog $alias"; + } + else { + warn("postalias='$prog' not found"); + } } @@ -279,14 +284,20 @@ sub postfix_alias_maps my ($self, $curproc, $params, $optargs) = @_; my $config = $curproc->{ config }; my $prog = $config->{ path_postconf }; + my $maps = ''; # XXX-TODO: postconf returns $xxx in some cases. we need to expand it. - my $maps = `$prog alias_maps`; - $maps =~ s/,/ /g; - $maps =~ s/\s+hash:/ /g; - $maps =~ s/\s+dbm:/ /g; - $maps =~ s/^.*=\s*//; - $maps =~ s/[\s\n]*$//; + if (-x $prog) { + $maps = `$prog alias_maps`; + $maps =~ s/,/ /g; + $maps =~ s/\s+hash:/ /g; + $maps =~ s/\s+dbm:/ /g; + $maps =~ s/^.*=\s*//; + $maps =~ s/[\s\n]*$//; + } + else { + warn("postconf='$prog' not found"); + } my (@maps) = split(/\s+/, $maps); return \@maps; @@ -411,7 +422,12 @@ sub postfix_update_virtual_map if (-f $virtual) { print STDERR "updating $virtual database\n"; - system "$postmap $virtual"; + if (-x $postmap) { + system "$postmap $virtual"; + } + else { + warn("postmap='$postmap' not found"); + } } } diff --git a/fml/lib/FML/MTAControl/Sendmail.pm b/fml/lib/FML/MTAControl/Sendmail.pm index 3378aa15..f4a9e6fe 100644 --- a/fml/lib/FML/MTAControl/Sendmail.pm +++ b/fml/lib/FML/MTAControl/Sendmail.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: Sendmail.pm,v 1.3 2003/03/04 04:42:34 fukachan Exp $ +# $FML: Sendmail.pm,v 1.4 2003/03/05 05:36:31 tmu Exp $ # package FML::MTAControl::Sendmail; @@ -70,7 +70,12 @@ sub sendmail_update_alias my $alias = $config->{ mail_aliases_file }; print STDERR "updating $alias database\n"; - system "$prog -bi -oA$alias"; + if (-x $prog) { + system "$prog -bi -oA$alias"; + } + else { + warn("sendmail='$prog' not found"); + } } @@ -150,7 +155,6 @@ sub sendmail_install_virtual_map my $config = $curproc->{ config }; my $ml_name = $config->{ ml_name }; my $ml_domain = $config->{ ml_domain }; - my $postmap = $config->{ path_postmap }; use File::Spec; my $virtual = $config->{ sendmail_virtual_map_file }; @@ -214,7 +218,12 @@ sub sendmail_update_virtual_map # XXX-TODO: NOT IMPLEMENTED if (-f $virtual) { print STDERR "updating $virtual database\n"; - system "$makemap hash $virtual < $virtual"; + if (-x $makemap) { + system "$makemap hash $virtual < $virtual"; + } + else { + warn("makemap='$makemap' not found"); + } } } |
