diff options
| author | fukachan <fukachan> | 2003-12-28 13:23:16 +0000 |
|---|---|---|
| committer | fukachan <fukachan> | 2003-12-28 13:23:16 +0000 |
| commit | dd2095e7346b99e4b2b7590a8520c7e2076a8a80 (patch) | |
| tree | 0593e20b7463249010ca44eaff593bc2e564bb7e /fml/lib | |
| parent | 1c03a55a289e7a2b1cab369ed4baa78ed50e04e6 (diff) | |
| download | fml8-dd2095e7346b99e4b2b7590a8520c7e2076a8a80.tar.gz fml8-dd2095e7346b99e4b2b7590a8520c7e2076a8a80.tar.bz2 fml8-dd2095e7346b99e4b2b7590a8520c7e2076a8a80.zip | |
clean up class hierarchy.
o FML::HomeDir::Prefix -> FML::ML::HomePrefix;
o FML::MTAControl -> FML::MTA::Control
o move main codes in newml and rmml to FML::ML::Control class.
Diffstat (limited to 'fml/lib')
| -rw-r--r-- | fml/lib/FML/Command/Admin/newdomain.pm | 6 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/newml.pm | 423 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/rmdomain.pm | 6 | ||||
| -rw-r--r-- | fml/lib/FML/Command/Admin/rmml.pm | 71 | ||||
| -rw-r--r-- | fml/lib/FML/ML/Control.pm | 538 | ||||
| -rw-r--r-- | fml/lib/FML/ML/HomePrefix.pm (renamed from fml/lib/FML/HomeDir/Prefix.pm) | 10 | ||||
| -rw-r--r-- | fml/lib/FML/MTA/Control.pm (renamed from fml/lib/FML/MTAControl.pm) | 28 | ||||
| -rw-r--r-- | fml/lib/FML/MTA/Control/Postfix.pm (renamed from fml/lib/FML/MTAControl/Postfix.pm) | 8 | ||||
| -rw-r--r-- | fml/lib/FML/MTA/Control/Procmail.pm (renamed from fml/lib/FML/MTAControl/Procmail.pm) | 8 | ||||
| -rw-r--r-- | fml/lib/FML/MTA/Control/Qmail.pm (renamed from fml/lib/FML/MTAControl/Qmail.pm) | 8 | ||||
| -rw-r--r-- | fml/lib/FML/MTA/Control/Sendmail.pm (renamed from fml/lib/FML/MTAControl/Sendmail.pm) | 8 | ||||
| -rw-r--r-- | fml/lib/FML/MTA/Control/Utils.pm (renamed from fml/lib/FML/MTAControl/Utils.pm) | 8 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Addr.pm | 6 | ||||
| -rw-r--r-- | fml/lib/FML/Process/Alias.pm | 6 |
14 files changed, 608 insertions, 526 deletions
diff --git a/fml/lib/FML/Command/Admin/newdomain.pm b/fml/lib/FML/Command/Admin/newdomain.pm index 2ca56a8e..bbe823d2 100644 --- a/fml/lib/FML/Command/Admin/newdomain.pm +++ b/fml/lib/FML/Command/Admin/newdomain.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: newdomain.pm,v 1.3 2003/11/16 12:23:47 fukachan Exp $ +# $FML: newdomain.pm,v 1.4 2003/11/16 23:49:12 fukachan Exp $ # package FML::Command::Admin::newdomain; @@ -61,8 +61,8 @@ sub process my $error = ''; if ($domain && $prefix) { - use FML::HomeDir::Prefix; - my $ml_home_prefix = new FML::HomeDir::Prefix $curproc; + use FML::ML::HomePrefix; + my $ml_home_prefix = new FML::ML::HomePrefix $curproc; $ml_home_prefix->add($domain, $prefix); } elsif ($domain && (! $prefix)) { diff --git a/fml/lib/FML/Command/Admin/newml.pm b/fml/lib/FML/Command/Admin/newml.pm index 8e757f3c..24219a91 100644 --- a/fml/lib/FML/Command/Admin/newml.pm +++ b/fml/lib/FML/Command/Admin/newml.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: newml.pm,v 1.72 2003/10/15 01:03:29 fukachan Exp $ +# $FML: newml.pm,v 1.73 2003/12/20 07:52:30 fukachan Exp $ # package FML::Command::Admin::newml; @@ -103,8 +103,13 @@ sub process $config->set( 'ml_home_prefix', $ml_home_prefix ); $config->set( 'ml_home_dir', $ml_home_dir ); + use FML::ML::Control; + my $control = new FML::ML::Control; + # define _ml_name_xxx variables in $parms for virtual domain - $self->_adjust_params_for_virtual_domain($curproc, $command_args, $params); + $control->adjust_params_for_virtual_domain($curproc, + $command_args, + $params); # "makefml --force newml elena" creates elena ML even if elena # already exists. @@ -119,7 +124,7 @@ sub process # Example: search among all entries in postfix $alias_maps and /etc/passwd # XXX we assume /etc/passwd exists for backword compatibility # XXX on all unix plathomes. - if ($self->_is_mta_alias_maps_has_ml_entry($curproc, $params, $ml_name)) { + if ($control->is_mta_alias_maps_has_ml_entry($curproc,$params,$ml_name)) { unless (defined $options->{ force } ) { warn("$ml_name already exists (somewhere in MTA aliases)"); return ; @@ -135,412 +140,12 @@ sub process # prepare thread cgi interface at ? # ~fml/public_html/cgi-bin/fml/$domain/threadview.cgi ? # 5. prepare listinfo url - $self->_init_ml_home_dir($curproc, $command_args, $params); - $self->_install_template_files($curproc, $command_args, $params); - $self->_update_aliases($curproc, $command_args, $params); - $self->_setup_mail_archive_dir($curproc, $command_args, $params); - $self->_setup_cgi_interface($curproc, $command_args, $params); - $self->_setup_listinfo($curproc, $command_args, $params); -} - - -# Descriptions: generate _ml_name_xxx in $params -# Arguments: OBJ($self) -# OBJ($curproc) HASH_REF($command_args) HASH_REF($params) -# Side Effects: update $params -# Return Value: none -sub _adjust_params_for_virtual_domain -{ - my ($self, $curproc, $command_args, $params) = @_; - my ($ml_name_admin, $ml_name_ctl, $ml_name_error, - $ml_name_post,$ml_name_request); - my $ml_name = $params->{ _ml_name }; - my $ml_domain = $params->{ ml_domain }; - - if ($curproc->is_default_domain($ml_domain)) { - $ml_name_admin = sprintf("%s-%s",$ml_name,"admin",$ml_domain); - $ml_name_ctl = sprintf("%s-%s",$ml_name,"ctl",$ml_domain); - $ml_name_error = sprintf("%s-%s",$ml_name,"error",$ml_domain); - $ml_name_request = sprintf("%s-%s",$ml_name,"request",$ml_domain); - - # post is exceptional. - $ml_name_post = sprintf("%s",$ml_name, $ml_domain); - } - else { - # virtual domain case - $ml_name_admin = sprintf("%s-%s=%s",$ml_name,"admin",$ml_domain); - $ml_name_ctl = sprintf("%s-%s=%s",$ml_name,"ctl",$ml_domain); - $ml_name_error = sprintf("%s-%s=%s",$ml_name,"error",$ml_domain); - $ml_name_request = sprintf("%s-%s=%s",$ml_name,"request",$ml_domain); - - # post is exceptional. - $ml_name_post = sprintf("%s=%s",$ml_name, $ml_domain); - } - - $params->{ _ml_name_admin } = $ml_name_admin; - $params->{ _ml_name_ctl } = $ml_name_ctl; - $params->{ _ml_name_error } = $ml_name_error; - $params->{ _ml_name_post } = $ml_name_post; - $params->{ _ml_name_request } = $ml_name_request; -} - - -# Descriptions: create $ml_home_dir if needed -# Arguments: OBJ($self) -# OBJ($curproc) -# HASH_REF($command_args) -# HASH_REF($params) -# Side Effects: create $ml_home_dir dirctory if needed -# Return Value: none -sub _init_ml_home_dir -{ - my ($self, $curproc, $command_args, $params) = @_; - my $config = $curproc->config(); - my $ml_home_dir = $config->{ ml_home_dir }; - - unless (-d $ml_home_dir) { - $curproc->mkdir($ml_home_dir, "mode=public"); - } - - # $ml_home_dir/etc/mail - my $dirlist = $config->get_as_array_ref('newml_command_init_public_dirs'); - for my $_dir (@$dirlist) { - unless (-d $_dir) { - $curproc->ui_message("creating $_dir"); - $curproc->mkdir( $_dir, "mode=public"); - } - } - - $dirlist = $config->get_as_array_ref('newml_command_init_private_dirs'); - for my $_dir (@$dirlist) { - unless (-d $_dir) { - $curproc->ui_message("creating $_dir"); - $curproc->mkdir( $_dir, "mode=private"); - } - } -} - - -# Descriptions: install config.cf, include, include-ctl et. al. -# Arguments: OBJ($self) -# OBJ($curproc) -# HASH_REF($command_args) -# HASH_REF($params) -# Side Effects: install config.cf, include, include-ctl et. al. -# Return Value: none -sub _install_template_files -{ - my ($self, $curproc, $command_args, $params) = @_; - my $config = $curproc->config(); - my $template_dir = $curproc->template_files_dir_for_newml(); - my $ml_home_dir = $params->{ ml_home_dir }; - my $templ_files = - $config->get_as_array_ref('newml_command_template_files'); - - # 1. set up fml specific files e.g. config.cf - use File::Spec; - for my $file (@$templ_files) { - my $src = File::Spec->catfile($template_dir, $file); - my $dst = File::Spec->catfile($ml_home_dir, $file); - - $curproc->ui_message("creating $dst"); - _install($src, $dst, $params); - } - - # 2. set up MTA specific files e.g. include, .qmail-* - use FML::MTAControl; - - # 2.1 setup include include-ctl ... (postfix/sendmail style) - # 2.2 setup ~fml/.qmail-* (qmail style) - my $list = $config->get_as_array_ref('newml_command_mta_config_list'); - for my $mta (@$list) { - my $obj = new FML::MTAControl { mta_type => $mta }; - $obj->setup($curproc, $params); - } -} - - -# Descriptions: update aliases entry -# Arguments: OBJ($self) -# OBJ($curproc) -# HASH_REF($command_args) -# HASH_REF($params) -# Side Effects: update aliases entry -# Return Value: none -sub _update_aliases -{ - my ($self, $curproc, $command_args, $params) = @_; - my $config = $curproc->config(); - my $ml_name = $config->{ ml_name }; - my $ml_domain = $config->{ ml_domain }; - my $alias = $config->{ mail_aliases_file }; - my $mask = umask( 022 ); - - # append - if ($self->_is_mta_alias_maps_has_ml_entry($curproc, $params, $ml_name)) { - $curproc->ui_message("warning: $ml_name already defined!"); - $curproc->ui_message(" ignore aliases updating"); - $curproc->logwarn("$ml_name ml already defined"); - } - else { - my $list = $config->get_as_array_ref('newml_command_mta_config_list'); - eval q{ - for my $mta (@$list) { - my $optargs = { mta_type => $mta, key => $ml_name }; - - use FML::MTAControl; - my $obj = new FML::MTAControl; - my $found = $obj->find_key_in_alias_maps($curproc, $params, { - mta_type => $mta, - key => $ml_name, - }); - - # we need to use the original $params here - # update templates for qmail/control/virtualdomains - unless ($curproc->is_default_domain($ml_domain)) { - $obj->install_virtual_map($curproc, $params, $optargs); - $obj->update_virtual_map($curproc, $params, $optargs); - } - - if ($found) { - $curproc->ui_message("skipping alias update for $mta"); - } - else { - $obj->install_alias($curproc, $params, $optargs); - $obj->update_alias($curproc, $params, $optargs); - } - } - }; - croak($@) if $@; - } - - umask( $mask ); -} - - -# Descriptions: $alias file has an $ml_name entry or not -# Arguments: OBJ($self) OBJ($curproc) HASH_REF($params) STR($ml_name) -# Side Effects: none -# Return Value: NUM( 1 or 0 ) -sub _is_mta_alias_maps_has_ml_entry -{ - my ($self, $curproc, $params, $ml_name) = @_; - my $config = $curproc->config(); - my $list = $config->get_as_array_ref('newml_command_mta_config_list'); - my $found = 0; - - eval q{ - use FML::MTAControl; - - my $obj = new FML::MTAControl; - if ($obj->is_user_entry_exist_in_passwd($ml_name)) { - my $s = "ml_name=$ml_name is found in passwd"; - $curproc->ui_message("error: $s"); - $curproc->logerror($s); - $found = 1; - } - - unless ($found) { - MTA: - for my $mta (@$list) { - my $obj = new FML::MTAControl; - $found = $obj->find_key_in_alias_maps($curproc, $params, { - mta_type => $mta, - key => $ml_name, - }); - - if ($found) { - my $s = "ml_name=$ml_name is found in $mta aliases"; - $curproc->ui_message("error: $s"); - $curproc->logerror($s); - last MTA; - } - } - } - }; - croak($@) if $@; - - return $found; -} - - -# Descriptions: set up ~fml/public_html/ for this mailing list -# Arguments: OBJ($self) -# OBJ($curproc) -# HASH_REF($command_args) -# HASH_REF($params) -# Side Effects: create directories for html articles -# Return Value: none -sub _setup_mail_archive_dir -{ - my ($self, $curproc, $command_args, $params) = @_; - my $config = $curproc->config(); - my $dir = $config->{ html_archive_dir }; - - unless (-d $dir) { - $curproc->ui_message("creating $dir"); - $curproc->mkdir($dir, "mode=public"); - } -} - - -# Descriptions: set up CGI interface for this mailing list but -# disable it by default. -# Arguments: OBJ($self) -# OBJ($curproc) -# HASH_REF($command_args) -# HASH_REF($params) -# Side Effects: create directories and install cgi scripts -# Return Value: none -sub _setup_cgi_interface -{ - my ($self, $curproc, $command_args, $params) = @_; - my $template_dir = $curproc->template_files_dir_for_newml(); - my $config = $curproc->config(); - - # - # 1. create directory path if needed - # - my (%is_dir_exists) = (); - my $cgi_base_dir = $config->{ cgi_base_dir }; - my $admin_cgi_dir = $config->{ admin_cgi_base_dir }; - my $ml_admin_cgi_dir = $config->{ ml_admin_cgi_base_dir }; - for my $dir ($cgi_base_dir, $admin_cgi_dir, $ml_admin_cgi_dir) { - unless (-d $dir) { - $curproc->ui_message("creating $dir"); - $is_dir_exists{ $dir } = 0; - $curproc->mkdir($dir, "mode=public"); - } - else { - $is_dir_exists{ $dir } = 1; - } - } - - # - # 2. disable CGI access by creating a dummy .htaccess - # install .htaccess only for the first time. - # - unless ( $is_dir_exists{ $cgi_base_dir } ) { - use File::Spec; - my $src = File::Spec->catfile($template_dir, 'dot_htaccess'); - my $dst = File::Spec->catfile($cgi_base_dir, '.htaccess'); - - $curproc->ui_message("creating $dst"); - $curproc->ui_message(" (a dummy to disable cgi by default)"); - _install($src, $dst, $params); - } - - # - # 3. install *.cgi - # - - use File::Spec; - my $libexec_dir = $config->{ fml_libexec_dir }; - my $src = File::Spec->catfile($libexec_dir, 'loader'); - my $ml_name = $config->{ ml_name }; - my $ml_domain = $config->{ ml_domain }; - - # 3.1 install admin/{menu,config,thread}.cgi - { - # hints - $params->{ __hints_for_fml_process__ } = qq{ - \$hints = { - cgi_mode => 'admin', - ml_name => '$ml_name', - ml_domain => '$ml_domain', - }; - }; - - use File::Spec; - for my $dst ( - File::Spec->catfile($admin_cgi_dir, 'menu.cgi'), - File::Spec->catfile($admin_cgi_dir, 'config.cgi'), - File::Spec->catfile($admin_cgi_dir, 'thread.cgi') - ) { - $curproc->ui_message("creating $dst"); - _install($src, $dst, $params); - chmod 0755, $dst; - } - } - - # - # 3.2. install ml-admin/ - { - # hints - $params->{ __hints_for_fml_process__ } = qq{ - \$hints = { - cgi_mode => 'ml-admin', - ml_name => '$ml_name', - ml_domain => '$ml_domain', - }; - }; - - use File::Spec; - for my $dst ( - File::Spec->catfile($ml_admin_cgi_dir, 'menu.cgi'), - File::Spec->catfile($ml_admin_cgi_dir, 'config.cgi'), - File::Spec->catfile($ml_admin_cgi_dir, 'thread.cgi') - ) { - $curproc->ui_message("creating $dst"); - _install($src, $dst, $params); - chmod 0755, $dst; - } - } -} - - -# Descriptions: install $dst with variable expansion of $src -# Arguments: STR($src) STR($dst) HASH_REF($config) -# Side Effects: create $dst -# Return Value: none -sub _install -{ - my ($src, $dst, $config) = @_; - - eval q{ - use FML::Config::Convert; - &FML::Config::Convert::convert_file($src, $dst, $config); - }; - croak($@) if $@; -} - - -# Descriptions: set up information for this mailing list. -# Arguments: OBJ($self) -# OBJ($curproc) -# HASH_REF($command_args) -# HASH_REF($params) -# Side Effects: create directories -# Return Value: none -sub _setup_listinfo -{ - my ($self, $curproc, $command_args, $params) = @_; - my $config = $curproc->config(); - my $template_dir = $config->{ listinfo_template_dir }; - my $listinfo_dir = $config->{ listinfo_dir }; - - unless (-d $listinfo_dir) { - $curproc->mkdir($listinfo_dir, "mode=public"); - } - - use DirHandle; - my $dh = new DirHandle $template_dir; - if (defined $dh) { - my $file = ''; - - FILE: - while (defined($file = $dh->read)) { - next FILE if $file =~ /^\./; - next FILE if $file =~ /^CVS/; - - use File::Spec; - my $src = File::Spec->catfile($template_dir, $file); - my $dst = File::Spec->catfile($listinfo_dir, $file); - - $curproc->ui_message("creating $dst"); - _install($src, $dst, $params); - } - } + $control->init_ml_home_dir($curproc, $command_args, $params); + $control->install_template_files($curproc, $command_args, $params); + $control->update_aliases($curproc, $command_args, $params); + $control->setup_mail_archive_dir($curproc, $command_args, $params); + $control->setup_cgi_interface($curproc, $command_args, $params); + $control->setup_listinfo($curproc, $command_args, $params); } diff --git a/fml/lib/FML/Command/Admin/rmdomain.pm b/fml/lib/FML/Command/Admin/rmdomain.pm index aa8d083c..f6a6ef35 100644 --- a/fml/lib/FML/Command/Admin/rmdomain.pm +++ b/fml/lib/FML/Command/Admin/rmdomain.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: rmdomain.pm,v 1.3 2003/11/16 12:23:47 fukachan Exp $ +# $FML: rmdomain.pm,v 1.4 2003/11/16 23:49:12 fukachan Exp $ # package FML::Command::Admin::rmdomain; @@ -59,8 +59,8 @@ sub process my $domain = $canon_argv->{ ml_name }; if ($domain) { - use FML::HomeDir::Prefix; - my $ml_home_prefix = new FML::HomeDir::Prefix $curproc; + use FML::ML::HomePrefix; + my $ml_home_prefix = new FML::ML::HomePrefix $curproc; $ml_home_prefix->delete($domain); } else { diff --git a/fml/lib/FML/Command/Admin/rmml.pm b/fml/lib/FML/Command/Admin/rmml.pm index dd518848..64fa32ba 100644 --- a/fml/lib/FML/Command/Admin/rmml.pm +++ b/fml/lib/FML/Command/Admin/rmml.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: rmml.pm,v 1.20 2003/09/27 03:00:16 fukachan Exp $ +# $FML: rmml.pm,v 1.21 2003/10/15 01:03:30 fukachan Exp $ # package FML::Command::Admin::rmml; @@ -95,71 +95,10 @@ sub process } # o.k. here we go! - $self->_remove_ml_home_dir($curproc, $command_args, $params); - $self->_remove_aliases($curproc, $command_args, $params); -} - - -# Descriptions: remove $ml_home_dir and update aliases if needed -# Arguments: OBJ($self) -# OBJ($curproc) -# HASH_REF($command_args) -# HASH_REF($params) -# Side Effects: remove ml_home_dir, update aliases entry -# Return Value: none -sub _remove_ml_home_dir -{ - my ($self, $curproc, $command_args, $params) = @_; - my $ml_name = $params->{ ml_name }; - my $ml_domain = $params->{ ml_domain }; - my $ml_home_prefix = $params->{ ml_home_prefix }; - my $ml_home_dir = $params->{ ml_home_dir }; - - $curproc->ui_message("removing ml_home_dir for $ml_name"); - - # /var/spool/ml/elena -> /var/spool/ml/@elena - my $removed_dir = - $curproc->removed_ml_home_dir_path($ml_home_prefix, $ml_name); - rename($ml_home_dir, $removed_dir); - - if (-d $removed_dir && (! -d $ml_home_dir)) { - $curproc->ui_message("removed"); - } - else { - my $s = "failed to remove ml_home_dir"; - $curproc->ui_message("error: $s"); - $curproc->logerror($s); - } -} - - -# Descriptions: remove aliases entry -# Arguments: OBJ($self) -# OBJ($curproc) -# HASH_REF($command_args) -# HASH_REF($params) -# Side Effects: update aliases entry -# Return Value: none -sub _remove_aliases -{ - my ($self, $curproc, $command_args, $params) = @_; - my $config = $curproc->config(); - my $ml_name = $params->{ ml_name }; - my $list = $config->get_as_array_ref('newml_command_mta_config_list'); - - eval q{ - use FML::MTAControl; - - for my $mta (@$list) { - my $optargs = { mta_type => $mta }; - my $obj = new FML::MTAControl; - $obj->remove_alias($curproc, $params, $optargs); - $obj->update_alias($curproc, $params, $optargs); - $obj->remove_virtual_map($curproc, $params, $optargs); - $obj->update_virtual_map($curproc, $params, $optargs); - } - }; - croak($@) if $@; + use FML::ML::Control; + my $control = new FML::ML::Control; + $control->remove_ml_home_dir($curproc, $command_args, $params); + $control->remove_aliases($curproc, $command_args, $params); } diff --git a/fml/lib/FML/ML/Control.pm b/fml/lib/FML/ML/Control.pm new file mode 100644 index 00000000..8bf5668d --- /dev/null +++ b/fml/lib/FML/ML/Control.pm @@ -0,0 +1,538 @@ +#-*- perl -*- +# +# Copyright (C) 2003 Ken'ichi Fukamachi +# All rights reserved. This program is free software; you can +# redistribute it and/or modify it under the same terms as Perl itself. +# +# $FML: Prefix.pm,v 1.1 2003/11/16 11:53:19 fukachan Exp $ +# + +package FML::ML::Control; +use strict; +use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD $debug); +use Carp; + + +=head1 NAME + +FML::ML::Control - create, rename and delete ml_home_dir. + +=head1 SYNOPSIS + +=head1 DESCRIPTION + +=head1 METHODS + +=cut + + +# Descriptions: standard constructor +# Arguments: OBJ($self) OBJ($curproc) +# Side Effects: none +# Return Value: OBJ +sub new +{ + my ($self, $curproc) = @_; + my ($type) = ref($self) || $self; + my $me = {}; + return bless $me, $type; +} + + +=head1 CREATE + +=cut + + +# Descriptions: generate _ml_name_xxx in $params +# Arguments: OBJ($self) +# OBJ($curproc) HASH_REF($command_args) HASH_REF($params) +# Side Effects: update $params +# Return Value: none +sub adjust_params_for_virtual_domain +{ + my ($self, $curproc, $command_args, $params) = @_; + my ($ml_name_admin, $ml_name_ctl, $ml_name_error, + $ml_name_post,$ml_name_request); + my $ml_name = $params->{ _ml_name }; + my $ml_domain = $params->{ ml_domain }; + + if ($curproc->is_default_domain($ml_domain)) { + $ml_name_admin = sprintf("%s-%s",$ml_name,"admin",$ml_domain); + $ml_name_ctl = sprintf("%s-%s",$ml_name,"ctl",$ml_domain); + $ml_name_error = sprintf("%s-%s",$ml_name,"error",$ml_domain); + $ml_name_request = sprintf("%s-%s",$ml_name,"request",$ml_domain); + + # post is exceptional. + $ml_name_post = sprintf("%s",$ml_name, $ml_domain); + } + else { + # virtual domain case + $ml_name_admin = sprintf("%s-%s=%s",$ml_name,"admin",$ml_domain); + $ml_name_ctl = sprintf("%s-%s=%s",$ml_name,"ctl",$ml_domain); + $ml_name_error = sprintf("%s-%s=%s",$ml_name,"error",$ml_domain); + $ml_name_request = sprintf("%s-%s=%s",$ml_name,"request",$ml_domain); + + # post is exceptional. + $ml_name_post = sprintf("%s=%s",$ml_name, $ml_domain); + } + + $params->{ _ml_name_admin } = $ml_name_admin; + $params->{ _ml_name_ctl } = $ml_name_ctl; + $params->{ _ml_name_error } = $ml_name_error; + $params->{ _ml_name_post } = $ml_name_post; + $params->{ _ml_name_request } = $ml_name_request; +} + + +# Descriptions: create $ml_home_dir if needed +# Arguments: OBJ($self) +# OBJ($curproc) +# HASH_REF($command_args) +# HASH_REF($params) +# Side Effects: create $ml_home_dir dirctory if needed +# Return Value: none +sub init_ml_home_dir +{ + my ($self, $curproc, $command_args, $params) = @_; + my $config = $curproc->config(); + my $ml_home_dir = $config->{ ml_home_dir }; + + unless (-d $ml_home_dir) { + $curproc->mkdir($ml_home_dir, "mode=public"); + } + + # $ml_home_dir/etc/mail + my $dirlist = $config->get_as_array_ref('newml_command_init_public_dirs'); + for my $_dir (@$dirlist) { + unless (-d $_dir) { + $curproc->ui_message("creating $_dir"); + $curproc->mkdir( $_dir, "mode=public"); + } + } + + $dirlist = $config->get_as_array_ref('newml_command_init_private_dirs'); + for my $_dir (@$dirlist) { + unless (-d $_dir) { + $curproc->ui_message("creating $_dir"); + $curproc->mkdir( $_dir, "mode=private"); + } + } +} + + +# Descriptions: install config.cf, include, include-ctl et. al. +# Arguments: OBJ($self) +# OBJ($curproc) +# HASH_REF($command_args) +# HASH_REF($params) +# Side Effects: install config.cf, include, include-ctl et. al. +# Return Value: none +sub install_template_files +{ + my ($self, $curproc, $command_args, $params) = @_; + my $config = $curproc->config(); + my $template_dir = $curproc->template_files_dir_for_newml(); + my $ml_home_dir = $params->{ ml_home_dir }; + my $templ_files = + $config->get_as_array_ref('newml_command_template_files'); + + # 1. set up fml specific files e.g. config.cf + use File::Spec; + for my $file (@$templ_files) { + my $src = File::Spec->catfile($template_dir, $file); + my $dst = File::Spec->catfile($ml_home_dir, $file); + + $curproc->ui_message("creating $dst"); + $self->_install($src, $dst, $params); + } + + # 2. set up MTA specific files e.g. include, .qmail-* + use FML::MTA::Control; + + # 2.1 setup include include-ctl ... (postfix/sendmail style) + # 2.2 setup ~fml/.qmail-* (qmail style) + my $list = $config->get_as_array_ref('newml_command_mta_config_list'); + for my $mta (@$list) { + my $obj = new FML::MTA::Control { mta_type => $mta }; + $obj->setup($curproc, $params); + } +} + + +# Descriptions: update aliases entry +# Arguments: OBJ($self) +# OBJ($curproc) +# HASH_REF($command_args) +# HASH_REF($params) +# Side Effects: update aliases entry +# Return Value: none +sub update_aliases +{ + my ($self, $curproc, $command_args, $params) = @_; + my $config = $curproc->config(); + my $ml_name = $config->{ ml_name }; + my $ml_domain = $config->{ ml_domain }; + my $alias = $config->{ mail_aliases_file }; + my $mask = umask( 022 ); + + # append + if ($self->is_mta_alias_maps_has_ml_entry($curproc, $params, $ml_name)) { + $curproc->ui_message("warning: $ml_name already defined!"); + $curproc->ui_message(" ignore aliases updating"); + $curproc->logwarn("$ml_name ml already defined"); + } + else { + my $list = $config->get_as_array_ref('newml_command_mta_config_list'); + eval q{ + for my $mta (@$list) { + my $optargs = { mta_type => $mta, key => $ml_name }; + + use FML::MTA::Control; + my $obj = new FML::MTA::Control; + my $found = $obj->find_key_in_alias_maps($curproc, $params, { + mta_type => $mta, + key => $ml_name, + }); + + # we need to use the original $params here + # update templates for qmail/control/virtualdomains + unless ($curproc->is_default_domain($ml_domain)) { + $obj->install_virtual_map($curproc, $params, $optargs); + $obj->update_virtual_map($curproc, $params, $optargs); + } + + if ($found) { + $curproc->ui_message("skipping alias update for $mta"); + } + else { + $obj->install_alias($curproc, $params, $optargs); + $obj->update_alias($curproc, $params, $optargs); + } + } + }; + croak($@) if $@; + } + + umask( $mask ); +} + + +# Descriptions: $alias file has an $ml_name entry or not +# Arguments: OBJ($self) OBJ($curproc) HASH_REF($params) STR($ml_name) +# Side Effects: none +# Return Value: NUM( 1 or 0 ) +sub is_mta_alias_maps_has_ml_entry +{ + my ($self, $curproc, $params, $ml_name) = @_; + my $config = $curproc->config(); + my $list = $config->get_as_array_ref('newml_command_mta_config_list'); + my $found = 0; + + eval q{ + use FML::MTA::Control; + + my $obj = new FML::MTA::Control; + if ($obj->is_user_entry_exist_in_passwd($ml_name)) { + my $s = "ml_name=$ml_name is found in passwd"; + $curproc->ui_message("error: $s"); + $curproc->logerror($s); + $found = 1; + } + + unless ($found) { + MTA: + for my $mta (@$list) { + my $obj = new FML::MTA::Control; + $found = $obj->find_key_in_alias_maps($curproc, $params, { + mta_type => $mta, + key => $ml_name, + }); + + if ($found) { + my $s = "ml_name=$ml_name is found in $mta aliases"; + $curproc->ui_message("error: $s"); + $curproc->logerror($s); + last MTA; + } + } + } + }; + croak($@) if $@; + + return $found; +} + + +# Descriptions: set up ~fml/public_html/ for this mailing list +# Arguments: OBJ($self) +# OBJ($curproc) +# HASH_REF($command_args) +# HASH_REF($params) +# Side Effects: create directories for html articles +# Return Value: none +sub setup_mail_archive_dir +{ + my ($self, $curproc, $command_args, $params) = @_; + my $config = $curproc->config(); + my $dir = $config->{ html_archive_dir }; + + unless (-d $dir) { + $curproc->ui_message("creating $dir"); + $curproc->mkdir($dir, "mode=public"); + } +} + + +# Descriptions: set up CGI interface for this mailing list but +# disable it by default. +# Arguments: OBJ($self) +# OBJ($curproc) +# HASH_REF($command_args) +# HASH_REF($params) +# Side Effects: create directories and install cgi scripts +# Return Value: none +sub setup_cgi_interface +{ + my ($self, $curproc, $command_args, $params) = @_; + my $template_dir = $curproc->template_files_dir_for_newml(); + my $config = $curproc->config(); + + # + # 1. create directory path if needed + # + my (%is_dir_exists) = (); + my $cgi_base_dir = $config->{ cgi_base_dir }; + my $admin_cgi_dir = $config->{ admin_cgi_base_dir }; + my $ml_admin_cgi_dir = $config->{ ml_admin_cgi_base_dir }; + for my $dir ($cgi_base_dir, $admin_cgi_dir, $ml_admin_cgi_dir) { + unless (-d $dir) { + $curproc->ui_message("creating $dir"); + $is_dir_exists{ $dir } = 0; + $curproc->mkdir($dir, "mode=public"); + } + else { + $is_dir_exists{ $dir } = 1; + } + } + + # + # 2. disable CGI access by creating a dummy .htaccess + # install .htaccess only for the first time. + # + unless ( $is_dir_exists{ $cgi_base_dir } ) { + use File::Spec; + my $src = File::Spec->catfile($template_dir, 'dot_htaccess'); + my $dst = File::Spec->catfile($cgi_base_dir, '.htaccess'); + + $curproc->ui_message("creating $dst"); + $curproc->ui_message(" (a dummy to disable cgi by default)"); + $self->_install($src, $dst, $params); + } + + # + # 3. install *.cgi + # + + use File::Spec; + my $libexec_dir = $config->{ fml_libexec_dir }; + my $src = File::Spec->catfile($libexec_dir, 'loader'); + my $ml_name = $config->{ ml_name }; + my $ml_domain = $config->{ ml_domain }; + + # 3.1 install admin/{menu,config,thread}.cgi + { + # hints + $params->{ __hints_for_fml_process__ } = qq{ + \$hints = { + cgi_mode => 'admin', + ml_name => '$ml_name', + ml_domain => '$ml_domain', + }; + }; + + use File::Spec; + for my $dst ( + File::Spec->catfile($admin_cgi_dir, 'menu.cgi'), + File::Spec->catfile($admin_cgi_dir, 'config.cgi'), + File::Spec->catfile($admin_cgi_dir, 'thread.cgi') + ) { + $curproc->ui_message("creating $dst"); + $self->_install($src, $dst, $params); + chmod 0755, $dst; + } + } + + # + # 3.2. install ml-admin/ + { + # hints + $params->{ __hints_for_fml_process__ } = qq{ + \$hints = { + cgi_mode => 'ml-admin', + ml_name => '$ml_name', + ml_domain => '$ml_domain', + }; + }; + + use File::Spec; + for my $dst ( + File::Spec->catfile($ml_admin_cgi_dir, 'menu.cgi'), + File::Spec->catfile($ml_admin_cgi_dir, 'config.cgi'), + File::Spec->catfile($ml_admin_cgi_dir, 'thread.cgi') + ) { + $curproc->ui_message("creating $dst"); + $self->_install($src, $dst, $params); + chmod 0755, $dst; + } + } +} + + +# Descriptions: install $dst with variable expansion of $src +# Arguments: OBJ($self) STR($src) STR($dst) HASH_REF($config) +# Side Effects: create $dst +# Return Value: none +sub _install +{ + my ($self, $src, $dst, $config) = @_; + + eval q{ + use FML::Config::Convert; + &FML::Config::Convert::convert_file($src, $dst, $config); + }; + croak($@) if $@; +} + + +# Descriptions: set up information for this mailing list. +# Arguments: OBJ($self) +# OBJ($curproc) +# HASH_REF($command_args) +# HASH_REF($params) +# Side Effects: create directories +# Return Value: none +sub setup_listinfo +{ + my ($self, $curproc, $command_args, $params) = @_; + my $config = $curproc->config(); + my $template_dir = $config->{ listinfo_template_dir }; + my $listinfo_dir = $config->{ listinfo_dir }; + + unless (-d $listinfo_dir) { + $curproc->mkdir($listinfo_dir, "mode=public"); + } + + use DirHandle; + my $dh = new DirHandle $template_dir; + if (defined $dh) { + my $file = ''; + + FILE: + while (defined($file = $dh->read)) { + next FILE if $file =~ /^\./; + next FILE if $file =~ /^CVS/; + + use File::Spec; + my $src = File::Spec->catfile($template_dir, $file); + my $dst = File::Spec->catfile($listinfo_dir, $file); + + $curproc->ui_message("creating $dst"); + $self->_install($src, $dst, $params); + } + } +} + + +=head1 REMOVE + +=cut + + +# Descriptions: remove $ml_home_dir and update aliases if needed +# Arguments: OBJ($self) +# OBJ($curproc) +# HASH_REF($command_args) +# HASH_REF($params) +# Side Effects: remove ml_home_dir, update aliases entry +# Return Value: none +sub remove_ml_home_dir +{ + my ($self, $curproc, $command_args, $params) = @_; + my $ml_name = $params->{ ml_name }; + my $ml_domain = $params->{ ml_domain }; + my $ml_home_prefix = $params->{ ml_home_prefix }; + my $ml_home_dir = $params->{ ml_home_dir }; + + $curproc->ui_message("removing ml_home_dir for $ml_name"); + + # /var/spool/ml/elena -> /var/spool/ml/@elena + my $removed_dir = + $curproc->removed_ml_home_dir_path($ml_home_prefix, $ml_name); + rename($ml_home_dir, $removed_dir); + + if (-d $removed_dir && (! -d $ml_home_dir)) { + $curproc->ui_message("removed"); + } + else { + my $s = "failed to remove ml_home_dir"; + $curproc->ui_message("error: $s"); + $curproc->logerror($s); + } +} + + +# Descriptions: remove aliases entry +# Arguments: OBJ($self) +# OBJ($curproc) +# HASH_REF($command_args) +# HASH_REF($params) +# Side Effects: update aliases entry +# Return Value: none +sub remove_aliases +{ + my ($self, $curproc, $command_args, $params) = @_; + my $config = $curproc->config(); + my $ml_name = $params->{ ml_name }; + my $list = $config->get_as_array_ref('newml_command_mta_config_list'); + + eval q{ + use FML::MTA::Control; + + for my $mta (@$list) { + my $optargs = { mta_type => $mta }; + my $obj = new FML::MTA::Control; + $obj->remove_alias($curproc, $params, $optargs); + $obj->update_alias($curproc, $params, $optargs); + $obj->remove_virtual_map($curproc, $params, $optargs); + $obj->update_virtual_map($curproc, $params, $optargs); + } + }; + croak($@) if $@; +} + + +=head1 CODING STYLE + +See C<http://www.fml.org/software/FNF/> on fml coding style guide. + +=head1 AUTHOR + +Ken'ichi Fukamachi + +=head1 COPYRIGHT + +Copyright (C) 2003 Ken'ichi Fukamachi + +All rights reserved. This program is free software; you can +redistribute it and/or modify it under the same terms as Perl itself. + +=head1 HISTORY + +FML::ML::Control first appeared in fml8 mailing list driver package. +See C<http://www.fml.org/> for more details. + +=cut + + +1; diff --git a/fml/lib/FML/HomeDir/Prefix.pm b/fml/lib/FML/ML/HomePrefix.pm index bdf8ca7c..bc208fe1 100644 --- a/fml/lib/FML/HomeDir/Prefix.pm +++ b/fml/lib/FML/ML/HomePrefix.pm @@ -4,10 +4,10 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: UserControl.pm,v 1.34 2003/11/08 06:51:49 fukachan Exp $ +# $FML: Prefix.pm,v 1.1 2003/11/16 11:53:19 fukachan Exp $ # -package FML::HomeDir::Prefix; +package FML::ML::HomePrefix; use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD $debug); use Carp; @@ -23,7 +23,7 @@ $debug = 0; =head1 NAME -FML::HomeDir::Prefix - create, rename and delete ml_home_prefix dir. +FML::ML::HomePrefix - create, rename and delete ml_home_prefix dir. =head1 SYNOPSIS @@ -190,7 +190,7 @@ if ($0 eq __FILE__) { $debug = 101; $| = 1; - my $ml_home_prefix = new FML::HomeDir::Prefix $curproc; + my $ml_home_prefix = new FML::ML::HomePrefix $curproc; print "\n# add { $domain => $prefix }\n"; $ml_home_prefix->add($domain, $prefix); @@ -219,7 +219,7 @@ redistribute it and/or modify it under the same terms as Perl itself. =head1 HISTORY -FML::HomeDir::Prefix first appeared in fml8 mailing list driver package. +FML::ML::HomePrefix first appeared in fml8 mailing list driver package. See C<http://www.fml.org/> for more details. =cut diff --git a/fml/lib/FML/MTAControl.pm b/fml/lib/FML/MTA/Control.pm index f70c9dc0..39d2672f 100644 --- a/fml/lib/FML/MTAControl.pm +++ b/fml/lib/FML/MTA/Control.pm @@ -4,24 +4,24 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: MTAControl.pm,v 1.20 2003/02/20 04:32:49 fukachan Exp $ +# $FML: MTAControl.pm,v 1.21 2003/09/13 09:16:59 fukachan Exp $ # -package FML::MTAControl; +package FML::MTA::Control; use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; -use FML::MTAControl::Postfix; -use FML::MTAControl::Qmail; -use FML::MTAControl::Procmail; -use FML::MTAControl::Sendmail; -use FML::MTAControl::Utils; -@ISA = qw(FML::MTAControl::Postfix - FML::MTAControl::Qmail - FML::MTAControl::Procmail - FML::MTAControl::Sendmail - FML::MTAControl::Utils +use FML::MTA::Control::Postfix; +use FML::MTA::Control::Qmail; +use FML::MTA::Control::Procmail; +use FML::MTA::Control::Sendmail; +use FML::MTA::Control::Utils; +@ISA = qw(FML::MTA::Control::Postfix + FML::MTA::Control::Qmail + FML::MTA::Control::Procmail + FML::MTA::Control::Sendmail + FML::MTA::Control::Utils ); my $debug = 0; @@ -29,7 +29,7 @@ my $debug = 0; =head1 NAME -FML::MTAControl - utilities to handle MTA specific configurations +FML::MTA::Control - utilities to handle MTA specific configurations =head1 SYNOPSIS @@ -358,7 +358,7 @@ redistribute it and/or modify it under the same terms as Perl itself. =head1 HISTORY -FML::MTAControl first appeared in fml8 mailing list driver package. +FML::MTA::Control first appeared in fml8 mailing list driver package. See C<http://www.fml.org/> for more details. =cut diff --git a/fml/lib/FML/MTAControl/Postfix.pm b/fml/lib/FML/MTA/Control/Postfix.pm index c933c33e..12925ecd 100644 --- a/fml/lib/FML/MTAControl/Postfix.pm +++ b/fml/lib/FML/MTA/Control/Postfix.pm @@ -4,10 +4,10 @@ # 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.22 2003/09/12 00:02:09 fukachan Exp $ +# $FML: Postfix.pm,v 1.23 2003/09/13 09:17:00 fukachan Exp $ # -package FML::MTAControl::Postfix; +package FML::MTA::Control::Postfix; use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; @@ -17,7 +17,7 @@ my $debug = 0; =head1 NAME -FML::MTAControl::Postfix - handle postfix specific configurations +FML::MTA::Control::Postfix - handle postfix specific configurations =head1 SYNOPSIS @@ -463,7 +463,7 @@ redistribute it and/or modify it under the same terms as Perl itself. =head1 HISTORY -FML::MTAControl first appeared in fml8 mailing list driver package. +FML::MTA::Control first appeared in fml8 mailing list driver package. See C<http://www.fml.org/> for more details. =cut diff --git a/fml/lib/FML/MTAControl/Procmail.pm b/fml/lib/FML/MTA/Control/Procmail.pm index dccd0acb..3f01b1f9 100644 --- a/fml/lib/FML/MTAControl/Procmail.pm +++ b/fml/lib/FML/MTA/Control/Procmail.pm @@ -4,10 +4,10 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Procmail.pm,v 1.14 2003/09/13 09:17:00 fukachan Exp $ +# $FML: Procmail.pm,v 1.15 2003/09/14 03:53:47 fukachan Exp $ # -package FML::MTAControl::Procmail; +package FML::MTA::Control::Procmail; use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; @@ -17,7 +17,7 @@ my $debug = 0; =head1 NAME -FML::MTAControl::Procmail - handle procmail specific configurations +FML::MTA::Control::Procmail - handle procmail specific configurations =head1 SYNOPSIS @@ -305,7 +305,7 @@ redistribute it and/or modify it under the same terms as Perl itself. =head1 HISTORY -FML::MTAControl first appeared in fml8 mailing list driver package. +FML::MTA::Control first appeared in fml8 mailing list driver package. See C<http://www.fml.org/> for more details. =cut diff --git a/fml/lib/FML/MTAControl/Qmail.pm b/fml/lib/FML/MTA/Control/Qmail.pm index 4f18a5e1..9bb2e016 100644 --- a/fml/lib/FML/MTAControl/Qmail.pm +++ b/fml/lib/FML/MTA/Control/Qmail.pm @@ -4,10 +4,10 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Qmail.pm,v 1.18 2003/09/13 09:17:00 fukachan Exp $ +# $FML: Qmail.pm,v 1.19 2003/10/15 01:03:33 fukachan Exp $ # -package FML::MTAControl::Qmail; +package FML::MTA::Control::Qmail; use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; @@ -17,7 +17,7 @@ my $debug = 0; =head1 NAME -FML::MTAControl::Qmail - handle qmail specific configurations +FML::MTA::Control::Qmail - handle qmail specific configurations =head1 SYNOPSIS @@ -256,7 +256,7 @@ redistribute it and/or modify it under the same terms as Perl itself. =head1 HISTORY -FML::MTAControl first appeared in fml8 mailing list driver package. +FML::MTA::Control first appeared in fml8 mailing list driver package. See C<http://www.fml.org/> for more details. =cut diff --git a/fml/lib/FML/MTAControl/Sendmail.pm b/fml/lib/FML/MTA/Control/Sendmail.pm index 9a3a80f2..746fa4ea 100644 --- a/fml/lib/FML/MTAControl/Sendmail.pm +++ b/fml/lib/FML/MTA/Control/Sendmail.pm @@ -4,10 +4,10 @@ # 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.6 2003/08/29 15:34:06 fukachan Exp $ +# $FML: Sendmail.pm,v 1.7 2003/09/13 09:17:00 fukachan Exp $ # -package FML::MTAControl::Sendmail; +package FML::MTA::Control::Sendmail; use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; @@ -17,7 +17,7 @@ my $debug = 0; =head1 NAME -FML::MTAControl::Sendmail - handle sendmail specific configurations +FML::MTA::Control::Sendmail - handle sendmail specific configurations =head1 SYNOPSIS @@ -278,7 +278,7 @@ redistribute it and/or modify it under the same terms as Perl itself. =head1 HISTORY -FML::MTAControl first appeared in fml8 mailing list driver package. +FML::MTA::Control first appeared in fml8 mailing list driver package. See C<http://www.fml.org/> for more details. =cut diff --git a/fml/lib/FML/MTAControl/Utils.pm b/fml/lib/FML/MTA/Control/Utils.pm index b9984be3..49fd65bc 100644 --- a/fml/lib/FML/MTAControl/Utils.pm +++ b/fml/lib/FML/MTA/Control/Utils.pm @@ -4,10 +4,10 @@ # 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.1 2003/01/29 08:48:49 fukachan Exp $ +# $FML: Utils.pm,v 1.2 2003/02/09 12:31:43 fukachan Exp $ # -package FML::MTAControl::Utils; +package FML::MTA::Control::Utils; use strict; use vars qw(@ISA @EXPORT @EXPORT_OK $AUTOLOAD); use Carp; @@ -17,7 +17,7 @@ my $debug = 0; =head1 NAME -FML::MTAControl::Utils - utility functions +FML::MTA::Control::Utils - utility functions =head1 SYNOPSIS @@ -80,7 +80,7 @@ redistribute it and/or modify it under the same terms as Perl itself. =head1 HISTORY -FML::MTAControl::Utils first appeared in fml8 mailing list driver package. +FML::MTA::Control::Utils first appeared in fml8 mailing list driver package. See C<http://www.fml.org/> for more details. =cut diff --git a/fml/lib/FML/Process/Addr.pm b/fml/lib/FML/Process/Addr.pm index c68a6c5a..6a5a44a1 100644 --- a/fml/lib/FML/Process/Addr.pm +++ b/fml/lib/FML/Process/Addr.pm @@ -3,7 +3,7 @@ # Copyright (C) 2001,2002,2003 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Addr.pm,v 1.11 2003/08/29 15:34:06 fukachan Exp $ +# $FML: Addr.pm,v 1.12 2003/12/24 14:29:35 fukachan Exp $ # package FML::Process::Addr; @@ -218,8 +218,8 @@ sub _fmladdr my $options = $curproc->command_line_options(); my $mode = $options->{ n } ? 'fmlonly' : 'all'; - use FML::MTAControl; - my $mta = new FML::MTAControl; + use FML::MTA::Control; + my $mta = new FML::MTA::Control; my $aliases = $mta->get_aliases_as_hash_ref($curproc, {}, { mta_type => 'postfix', mode => $mode, diff --git a/fml/lib/FML/Process/Alias.pm b/fml/lib/FML/Process/Alias.pm index 13ea9f04..6ee2623b 100644 --- a/fml/lib/FML/Process/Alias.pm +++ b/fml/lib/FML/Process/Alias.pm @@ -3,7 +3,7 @@ # Copyright (C) 2001,2002,2003 Ken'ichi Fukamachi # All rights reserved. # -# $FML: Alias.pm,v 1.12 2003/08/29 15:34:06 fukachan Exp $ +# $FML: Alias.pm,v 1.13 2003/12/24 14:29:35 fukachan Exp $ # package FML::Process::Alias; @@ -218,8 +218,8 @@ sub _fmlalias my $options = $curproc->command_line_options(); my $mode = $options->{ n } ? 'fmlonly' : 'all'; - use FML::MTAControl; - my $mta = new FML::MTAControl; + use FML::MTA::Control; + my $mta = new FML::MTA::Control; my $aliases = $mta->get_aliases_as_hash_ref($curproc, {}, { mta_type => 'postfix', mode => $mode, |
