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.php 2009-07-08 09:38:07.000000000 -0300 > +++ config-patched.php 2009-07-08 09:39:46.000000000 -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