Index: [Article Count Order] [Thread]

Date:  Mon, 26 Feb 2007 08:47:38 +0100
From:  "Taco Scargo" <taco (at mark) scargo.nl>
Subject:  [coba-e:08946] Patch to aliasing code
To:  coba-e (at mark) bluequartz.org
Message-Id:  <20070226074738.M3431 (at mark) scargo.nl>
In-Reply-To:  <200702260739.l1Q7drkK008815 (at mark) hosting1.netvictory.net>
References:  <200702260739.l1Q7drkK008815 (at mark) hosting1.netvictory.net>
X-Mail-Count: 08946

Hi guysm

I cam across a bad design by my former colleagues which I would like to
correct with the patch below.

Issue:

When adding/modifying an web or e-mail alias, the code checks wether the alias
is already in use (by another site). When adding an e-mail alias that is in
use as a webalias by another site, BQ would refuse it, but this is valid as
long as there are no mail-aliases defined.

The same for adding a webalias. Have a look at the code I removed and the
comments above it. The reasoning just does not make sense.
It is completly valid to have 10 websites for web access and just have one of
the receive the mail for these domains.

I would be happy if Hisao or Brian could check this into CVS. Is Hisao still
alive ? I haven't seen any responses to earlier mails regarding patches I
submitted.

Thanks,

Taco

diff -u /usr/sausalito/handlers/base/vsite/unique.pl.orig
/usr/sausalito/handlers/base/vsite/unique.pl > /tmp/unique.pl.patch
--- /usr/sausalito/handlers/base/vsite/unique.pl.orig	2007-02-26
08:28:18.000000000 +0100
+++ /usr/sausalito/handlers/base/vsite/unique.pl	2007-02-26 08:37:32.000000000
+0100
@@ -83,24 +83,7 @@
 				       { 
 				       	'webAliases' => $search_regex
 				       });
-		#
-		# also verify that another site isn't using this
-		# as an email alias.  It doesn't really make any sense to
-		# allow one site to use a name as a web alias and another
-		# to use it as a mail alias, because it foobars DNS.
-		#
-		my @mail_oids = $cce->findx('Vsite', {},
-					{
-						'mailAliases' => $search_regex
-					});
-		#
-		# when checking for mail aliases need to handle the case
-		# when one site is found, because it is legal for the same
-		# site to use an alias for both email and web
-		#
-		if ((scalar(@oids) > 1) || (scalar(@mail_oids) > 1) ||
-		    ((scalar(@mail_oids) == 1) &&
-		     ($mail_oids[0] != $cce->event_oid()))) {
+		if (scalar(@oids) > 1) {
 			push @used_web_aliases, $alias;
 		}
 	}
@@ -128,22 +111,7 @@
 				       	'mailAliases' => $search_regex
 				       });
 
-		#
-		# also verify another site isn't using this as a web alias
-		# same reasoning as above for web aliases
-		#A
-		my @web_oids = $cce->findx('Vsite', {},
-					{
-						'webAliases' => $search_regex
-					});
-		#
-		# when checking for web aliases need to handle the case
-		# when one site is found, because it is legal for the same
-		# site to use an alias for both email and web
-		#
-		if ((scalar(@oids) > 1) || (scalar(@web_oids) > 1) ||
-		    ((scalar(@web_oids) == 1) &&
-		     ($web_oids[0] != $cce->event_oid()))) {
+		if (scalar(@oids) > 1) {
 			push @used_mail_aliases, $alias;
 		}
 	}