Koozali.org: home of the SME Server
Obsolete Releases => SME Server 7.x => Topic started by: calisun on March 12, 2008, 07:57:57 AM
-
I have several domains on my server, my question is, is there way to setup the server so webmail would be accessible only from certain domains.
ie. right now if I go to domainA/webmail and domainB/webmail I get horde log on screen in both cases.
What I want is domainA/webmail I get Horde log on screen, but domainB/webmail I get nothing or error message.
-
What I want is domainA/webmail I get Horde log on screen, but domainB/webmail I get nothing or error message.
That can be done with custom templates, but IMO would be pointless.
-
Thanks Charlie,
Do you or someone be able to show me how to setup custom template to do this. I have no idea how to set one up.
-
Do you or someone be able to show me how to setup custom template to do this.
I simply wouldn't bother. webmail is accessible - why do you care how many different URLs can be used to access it?
-
I have couple domains that have a lot of daily traffic (several thousand hits a day) people being people, they will poke around, so I don't want to give them any reason to poke around. I know that I have very secure passwords and they can't get in, but why give them temptation.
Besides, bandwidth is not cheap and all the poking around uses up bites that cost me money.
-
Does anybody know how to setup custom template to do this?
-
Does anybody know how to setup custom template to do this?
- Create the template tree:
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/
- Copy the template fragment we want to overwrite:
cp /etc/e-smith/templates/etc/httpd/conf/httpd.conf/VirtualHosts/30WebmailAliases \ /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/
- Change the following section in the copy (/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/VirtualHosts/30WebmailAliases) using your favorite editor (I use nano mostly):
foreach $place ('webmail','horde')
{
if (($port eq "80") && ($haveSSL eq 'yes') && ($webmailAccessType eq 'SSL'))
{
$OUT .= " RewriteRule ^/$place(/.*|\$) https://%{HTTP_HOST}/$place\$1 [L,R]\n";
} else {
$OUT .= " Alias /$place $dirs{$place}\n";
}
}
to
if ($virtualHost eq 'domain1.cc') {
foreach $place ('webmail','horde')
{
if (($port eq "80") && ($haveSSL eq 'yes') && ($webmailAccessType eq 'SSL'))
{
$OUT .= " RewriteRule ^/$place(/.*|\$) https://%{HTTP_HOST}/$place\$1 [L,R]\n";
} else {
$OUT .= " Alias /$place $dirs{$place}\n";
}
}
}
If you want multiple domains you can modify the first line of above fragment to read something like this:
if ( ($virtualHost eq 'domain1.cc') || ($virtualHost eq 'domain2.cc') ){
- After that regenerate the configuration file:
expand-template /etc/httpd/conf/httpd.conf
- And restart your webserver:
sv t httpd-e-smith
Above should result in a 404 error when trying to access webmail for a domain where is is not enabled.
Disclaimer: This is written down from the top of my head and is untested.
If you run in to troubles remove the modified template fragment (created in step 2) and re-run steps 4 and 5. This should reset your configuration to the working order it was in before making the modifications.
-
Thank you very much Cactus.
I will report back with results after I attempt this over the weekend.