squirrelmail globally under subdomain of each site

8 posts / 0 new
Last post
#1 Fri, 05/15/2009 - 04:10

squirrelmail globally under subdomain of each site

Hello, For a few days I have been trying webmin and virtualmin. It works like a breeze. I installed squirrelmail and it went ok. At the moment I am trying to find a way to install globally under a subdomain like http://webmail.mydomain.com - that is whenever I create a web site I want a webmail sobdoamin like above to be created for new site. I tried to add lines below to "Directives and settings for new websites"

<VirtualHost *:80> DocumentRoot /usr/share/squirrelmail/src ServerName webmail.${DOM} </VirtualHost>

But it gave error... later I realized it should not be there... and tried to find elsewhere... but could not find. when I add it manually it seems work...

Anyway, I like to learn: 1. Am I on the right way to achive what I want? 2. Is there a place to add the code above so it will be available globally 3. I want the squirrelmail full url not shownlike "http://mydomain/squirrelmail/src/login.php" in the browser, instead I Like to have "webmail.domain.com" Do I have to use rewrite url to achive this?

Thanks in advance

Fri, 05/15/2009 - 06:18

Hmm, well, a few thoughts:

1. If you're using a typical Virtualmin setup, you'll have trouble getting things to work in a DocumentRoot outside of /home. My suggestion would be that if you want to use Squirrelmail, you first create a new Virtual Server for it -- something like squirrelmail.yourdomain.com, and setup Squirrelmail within the public_html directory it creates for you.

This will create a centralized install of Squirrelmail that will allow it to be available for all users.

2. You can have it so that any user who types &quot;webmail.theirdomain.com&quot; will end up at this central Squirrelmail install. To do that, go into System Settings -&gt; Server Templates -&gt; Default -&gt; Apache Website, and modify &quot;URL for webmail redirect&quot;.

3. If you create a single Virtual Server for your Squirrelmail install, you can make the name anything you want. You shouldn't need to use any fancy rewriting unless you're trying to do something particularly unusual :-)

Have a good one,

Fri, 05/15/2009 - 09:03
Joe's picture

Eric's advice is spot-on for the easy ways to do this, but I'll add one thing that may not be immediately obvious about the way you're trying to do this:

Suexec will not allow a central installation to run within the VirtualHost sections of your virtual servers. The files in the central installation are owned by the Apache user...so suexec tries to run them as the Apache user, but Suexec refuses to allow that to happen, because the SuexecUserGroup doesn't match the Apache user.

Make sense?

If you <i>must</i> have it work this way, you'll need to create a special non-suexec VirtualHost for running SquirrelMail.

BTW-Can I get your thoughts on why you prefer SquirrelMail to Usermin? I'd like to know what we're doing wrong (I bugged people a few years ago about this, and we introduced the framed theme that give Usermin a more &quot;mail client&quot; appearance), but that doesn't seem to have convinced everybody. So I'm going to bug folks again about why they're choosing Squirrel over Usermin. (We're not going to beat you up about it. I just want to know how we can further improve Usermin.) ;-)


Check out the forum guidelines!

Fri, 05/15/2009 - 11:49

Hi again,
First of all, I should say I am not very skilled person about linux, webmin and virtualmin... I am only a person who loves learning - especially self learning... That is why I spent all the week setting up ubuntu, webmin, virtualmin, roundcube again and again trying to understand approach, logic and concerns behind them... I got impression that Webmin and virtualmin are really good products compared to other CPs and has more advantages... anyway,

# Eric
I am trying the approach you suggested... but I have not finished completely yet... I should check a few things more

# Joe
That suExec thing... my homework :) I will keep in mind and learn about it.

Why do I choose squirrelmail over usermin? Personally I do not have any preferences about webmail client... I prefer using mail client on my computer... I will share my observation in case it gives an idea.

Last week, while surfing to find comperative information about CPs I met someone saying &quot;ugly virtualmin&quot; and I deduced virtualmin must be good (since I am aware that most of the end-user-type people are after appearance more than function) and Now I am sure webmin&amp;virtualmin are really functional and do meet more than needs. And I observed people mention roundcube &quot;elegant&quot;.

Bearing in mind the attitudes of end users, I can say if the inward nature of virtualmin &amp; usermin is combined to simplicity and attractiveness (which is seeked for by most people) I am sure most of them will prefer using this indispensable duo.

fine intelligence and labour behind them is clear but - concerning end users- it needs to be integrated into simple and more attractive form.

One more thing, most of the world is accustomed to using outlook type or yahoo type clients... habits

Fri, 05/15/2009 - 12:20

Sorry for the double post... I do not know why it posted twice

Eric, it seems to work... thank you for your close interest and suggestion... now I will try Joe's spot about suExec...

when I enter &quot;webmail.domain.com&quot; it redirects url of central installation... so in the adress bar it is shown &quot;squirrelmail.anotherdomain.com&quot; I think this is the expected result of this method? is it possibel to have webmail.domain.com instead of redirect url.... so users feel they are in their own site.

Fri, 05/15/2009 - 14:28 (Reply to #5)

Yeah, redirecting to the central installation is the expected result of that method. Apache is watching for requests going to &quot;webmin.domain.com&quot;, and when it sees it, it redirects to the central install.

While there's probably ways to not redirect, I don't know of a simple way of doing that off the top of my head.

However, I might actually suggest going a different route.

Rather than trying to avoid the redirect -- I might go a step in the other direction and actually setup an SSL certificate for your centralized webmail install to secure it for your users and make sure their passwords aren't being transmitted in cleartext. Seeing that padlock can also add warm fuzzies for users :-)

You could either use a free self-signed certificate, or you could pay GoDaddy about $30 a year for a commercial certificate (which won't generate warning messages).

Sat, 05/16/2009 - 08:05

Here I tried another way.
Webmin -&gt; servers -&gt; Apache Webserver
Create virtualhost

Specific Adress: IP


Server name: subdomain.domain.com

Document root : Directory where Squirrelmail resides (In our case, it is on another host created for mail client)

Add virtual server to file:
New file under virtual servers directory /etc/apache2/sites-available

Copy directives:Nowhere
It seems this option gives us not to enable squirrelmail for all sites as default as we do not redirect from &quot;server templates -&gt; Default settings&quot; What I like to learn: Does this approach breaks anything in virtualmin?

Sat, 05/16/2009 - 15:29 (Reply to #7)

<div class='quote'>It seems this option gives us not to enable squirrelmail for all sites as default as we do not redirect from &quot;server templates -&gt; Default settings&quot; What I like to learn: Does this approach breaks anything in virtualmin?</div>

Does it break anything? Probably not, but I haven't tried creating a Virtual Server in that manner, so I'm not sure if there's any hidden gotchas :-)

If you're able to add additional Virtual Servers and things seem to work, then you're in good shape!

Topic locked