summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfukachan <fukachan>2003-04-19 06:13:00 +0000
committerfukachan <fukachan>2003-04-19 06:13:00 +0000
commit0c58368f2f6a719185ad23bb168b19fad45fe351 (patch)
tree3eab98b346d354e2171cf8d21b7403d11bab2e8f
parent5ba312572be1b86f294dc937d724f43d15332221 (diff)
downloadfml8-0c58368f2f6a719185ad23bb168b19fad45fe351.tar.gz
fml8-0c58368f2f6a719185ad23bb168b19fad45fe351.tar.bz2
fml8-0c58368f2f6a719185ad23bb168b19fad45fe351.zip
fix virtual domain handling (fml-devel:417)
-rw-r--r--fml/etc/aliases12
-rw-r--r--fml/etc/postfix_virtual10
-rw-r--r--fml/lib/FML/Command/Admin/newml.pm49
-rw-r--r--fml/lib/FML/Config/Convert.pm22
4 files changed, 80 insertions, 13 deletions
diff --git a/fml/etc/aliases b/fml/etc/aliases
index 224cb5c2..2506cf62 100644
--- a/fml/etc/aliases
+++ b/fml/etc/aliases
@@ -5,15 +5,15 @@ __ml_name__: :include:__ml_home_dir__/include
owner-__ml_name__: __fml_owner__
# address for command
-__ml_name__-ctl: :include:__ml_home_dir__/include-ctl
-owner-__ml_name__-ctl: __fml_owner__
+__ml_name_ctl__: :include:__ml_home_dir__/include-ctl
+owner-__ml_name_ctl__: __fml_owner__
# maintainer
-__ml_name__-request: __ml_name__-admin
-__ml_name__-admin: __fml_owner__, __ml_name__-error
+__ml_name_request__: __ml_name_admin__
+__ml_name_admin__: __fml_owner__, __ml_name_error__
# error analyzer
-__ml_name__-error: :include:__ml_home_dir__/include-error
-owner-__ml_name__-error: __fml_owner__
+__ml_name_error__: :include:__ml_home_dir__/include-error
+owner-__ml_name_error__: __fml_owner__
### </ALIASES __ml_name__@__ml_domain__ ML> ###
diff --git a/fml/etc/postfix_virtual b/fml/etc/postfix_virtual
index a8c0331d..542d950e 100644
--- a/fml/etc/postfix_virtual
+++ b/fml/etc/postfix_virtual
@@ -1,9 +1,9 @@
### <VIRTUAL __ml_name__@__ml_domain__ ML> ###
-__ml_name__@__ml_domain__ __ml_name__=__ml_domain__
-__ml_name__-ctl@__ml_domain__ __ml_name__-ctl=__ml_domain__
-__ml_name__-request@__ml_domain__ __ml_name__-request=__ml_domain__
-__ml_name__-admin@__ml_domain__ __ml_name__-admin=__ml_domain__
-__ml_name__-error@__ml_domain__ __ml_name__-error=__ml_domain__
+__ml_name__@__ml_domain__ __ml_name_post__
+__ml_name__-ctl@__ml_domain__ __ml_name_ctl__
+__ml_name__-request@__ml_domain__ __ml_name_request__
+__ml_name__-admin@__ml_domain__ __ml_name_admin__
+__ml_name__-error@__ml_domain__ __ml_name_error__
### </VIRTUAL __ml_name__@__ml_domain__ ML> ###
diff --git a/fml/lib/FML/Command/Admin/newml.pm b/fml/lib/FML/Command/Admin/newml.pm
index 6d13d2fe..61f1275d 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.62 2003/02/14 01:27:46 fukachan Exp $
+# $FML: newml.pm,v 1.63 2003/04/18 15:53:46 fukachan Exp $
#
package FML::Command::Admin::newml;
@@ -79,6 +79,9 @@ sub process
ml_domain => $ml_domain,
ml_home_prefix => $ml_home_prefix,
ml_home_dir => $ml_home_dir,
+
+ # non conversion ml_name, which is preserved for further use
+ _ml_name => $ml_name,
};
# mkdir $ml_home_prefix if could.
@@ -98,6 +101,9 @@ sub process
$config->set( 'ml_home_prefix', $ml_home_prefix );
$config->set( 'ml_home_dir', $ml_home_dir );
+ # define _ml_name_xxx variables in $parms for virtual domain
+ $self->_adjust_params_for_virtual_domain($curproc, $command_args, $params);
+
# "makefml --force newml elena" creates elena ML even if elena
# already exists.
unless (defined $options->{ force } ) {
@@ -134,6 +140,47 @@ sub process
}
+# 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)
diff --git a/fml/lib/FML/Config/Convert.pm b/fml/lib/FML/Config/Convert.pm
index f464c720..9781c587 100644
--- a/fml/lib/FML/Config/Convert.pm
+++ b/fml/lib/FML/Config/Convert.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: Convert.pm,v 1.14 2003/02/01 04:33:18 fukachan Exp $
+# $FML: Convert.pm,v 1.15 2003/02/01 06:12:17 fukachan Exp $
#
@@ -131,6 +131,26 @@ sub _replace
$buf =~ s/__ml_name__/$config->{ ml_name }/g;
}
+ if (defined $config->{ _ml_name_admin }) {
+ $buf =~ s/__ml_name_admin__/$config->{ _ml_name_admin }/g;
+ }
+
+ if (defined $config->{ _ml_name_ctl }) {
+ $buf =~ s/__ml_name_ctl__/$config->{ _ml_name_ctl }/g;
+ }
+
+ if (defined $config->{ _ml_name_error }) {
+ $buf =~ s/__ml_name_error__/$config->{ _ml_name_error }/g;
+ }
+
+ if (defined $config->{ _ml_name_post }) {
+ $buf =~ s/__ml_name_post__/$config->{ _ml_name_post }/g;
+ }
+
+ if (defined $config->{ _ml_name_request }) {
+ $buf =~ s/__ml_name_request__/$config->{ _ml_name_request }/g;
+ }
+
if (defined $config->{ ml_domain }) {
$buf =~ s/__ml_domain__/$config->{ ml_domain }/g;
}