Bug#536237: Enable specific domain configuration in SquirrelMail

2011-10-17 Thread Loïc Minier
Hey

On Wed, Jul 08, 2009, Arthur Furlan wrote:
 I usually have various domains in a same mailserver and I use to
 have a webmail.domain-name.org DNS entry for each of them. I also
 use to configure all these DNS entries in a same Apache's VirtualHost
 (using ServerAlias) and then I can access the same instance of
 SquirrelMail, under different server names (webmail.example1.org,
 webmail.example2.org, etc.), but sharing the same configuration and
 same VirtualHost in Apache.
 
 In this scenario, I usually need to add specific domain
 configurations in SquirrelMail like changing the $org_name,
 $org_title, $org_logo, $plugins, etc. and to be able to do that I
 needed to patch the default /etc/squirrelmail/config.php to load a
 new configuration file, based on the PHP's variable
 $_SERVER['SERVER_NAME']. This is a very useful feature for me and that
 I think could be added in the SquirrelMail default package.

 I've hit this case myself, and I think it's an elegant way to solve it
 indeed.  Apparently the Squirrelmail vlogin plugin is made for this
 purpose:
http://squirrelmail.org/plugin_view.php?id=47
 but it's not packaged.  I've looked at the plugin, and it seemed very
 rich in functionality, but I didn't really want to start messing with
 this plugin and also add the compatibility plugin just for the sake
 of pointing at a different system-wide config file for this or that
 domain.  Still, I wanted to mention this option in this bug; it might
 be useful in other cases.

 I do have a slightly different config fragment from yours:

 --- config.php2009-07-08 09:38:07.0 -0300
 +++ config-patched.php2009-07-08 09:39:46.0 -0300
 @@ -219,3 +219,7 @@
  $config_location_base = '';
  
  @include SM_PATH . 'config/config_local.php';
 +
 +// specific domain configurations
 +$config_domain = SM_PATH . 
 config/config_local-{$_SERVER['SERVER_NAME']}.php;
 +@include $config_domain;

 I do:

/* include VirtualHost specific config if present */
@include SM_PATH . config/config_{$_SERVER['HTTP_HOST']}.php;

 and I have the config at /etc/squirrelmail/config_$host.php.

 I suspect it would be a good idea to guard the include with some test
 on the contents of SERVER_NAME / HTTP_HOST though.

   Cheers,
-- 
Loïc Minier



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#536237: Enable specific domain configuration in SquirrelMail

2009-07-08 Thread Arthur Furlan
Package: squirrelmail
Version: 2:1.4.15-4+lenny2
Severity: wishlist

I usually have various domains in a same mailserver and I use to
have a webmail.domain-name.org DNS entry for each of them. I also
use to configure all these DNS entries in a same Apache's VirtualHost
(using ServerAlias) and then I can access the same instance of
SquirrelMail, under different server names (webmail.example1.org,
webmail.example2.org, etc.), but sharing the same configuration and
same VirtualHost in Apache.

In this scenario, I usually need to add specific domain
configurations in SquirrelMail like changing the $org_name,
$org_title, $org_logo, $plugins, etc. and to be able to do that I
needed to patch the default /etc/squirrelmail/config.php to load a
new configuration file, based on the PHP's variable
$_SERVER['SERVER_NAME']. This is a very useful feature for me and that
I think could be added in the SquirrelMail default package.


   I'm running Debian GNU/Linux 5.0 (Lenny) and Kernel 2.6.26-2-686.


-- 
Atenciosamente,

Arthur Furlan
arthur.fur...@gmail.com
--- config.php	2009-07-08 09:38:07.0 -0300
+++ config-patched.php	2009-07-08 09:39:46.0 -0300
@@ -219,3 +219,7 @@
 $config_location_base = '';
 
 @include SM_PATH . 'config/config_local.php';
+
+// specific domain configurations
+$config_domain = SM_PATH . config/config_local-{$_SERVER['SERVER_NAME']}.php;
+...@include $config_domain;