Setting up webmail with SquirrelMail
Posted by kink on Fri 29 Jul 2005 at 14:50
Ever since hotmail originally introduced the concept of a mailbox accessible over the web (way before Microsoft bought them), webmail has been a popular way of accessing email while on the road. This article describes setting up webmail for the users of your Debian system.
SquirrelMail is probably the most popular open source webmail client. It has a focus on compatibility, so it's usable even with the most archaic browser as long as it supports frames and cookies. Yet, it offers all features of a complete mail client.
For starters you'll need a PHP-enabled webserver, like apache or apache2 with the php4 module.
SquirrelMail runs on top of an IMAP-server. Having an IMAP-server installed and working is a pre-condition and is not really covered in this article.
Examples of good IMAP server packages are courier-imap, cyrus and dovecot. If you don't want to offer your users direct IMAP access, you can block outside access to port 143 except for the machine hosting SquirrelMail.
On to installing SquirrelMail. This is easy:
apt-get install squirrelmail
You'll see that it depends on squirrelmail-locales, the translations package. If you're using etch or sid, the squirrelmail-locales package is only recommended, so you can remove it if you have English speaking users exclusively.
After installation, it's time for configuration, run from the command line:
squirrelmail-configure
This will present an interactive menu where all possible aspects of SquirrelMail can be configured. Start with the bottom option, D. Set pre-defined settings for specific IMAP servers. This preloads some settings specifically for your IMAP server package.
Menu 1, Organisation Preferences, enables you to brand SquirrelMail with your own system name and logo. Menu 2, Server Settings is for configuring the backends of your webmail. The option "Domain" is the domain that is appended to your outgoing email. By default this is read from /etc/mailname.
Press A to configure your IMAP server. Changing the options "Authentication Type" and "TLS" will make the connection with your IMAP server more secure. However, this only makes sense when your IMAP server is not on localhost; encrypting traffic over the local interface is wasting processor cycles. The option Server Software should already be set to to your IMAP server package when you loaded the predefined settings. Option B, SMTP settings, should not have to be changed in most cases.
Menu 3 Folder Defaults can safely be left untouched. Under 4, General Options, you can make some tweaks. Be sure to set option 11, allow server-side sorting. This greatly improves SquirrelMail performance and works with nearly all IMAP servers. Feel free to look around the configuration options. I'd advise not to enable any plugins until you've verified that your current setup actually works. Once it does, you can add plugins. If something breaks, you'll know which plugin to blame.
Press S to save and Q to quit. Under /etc/squirrelmail you'll also find some configuration files for plugins and the file default_pref where you can set default preferences for new users.
Now to make the install web-accessible. With the configuration files you'll find an Apache configuration snippet you can edit and add to your Apache config. It's wise to add it to the configuration of Apache-SSL aswell, so your users can access their mailbox over a secure connection. After that, reload Apache. We should be done!
Now go to https://webmail.example.com/src/configtest.php (if you configured SquirrelMail at the webmail.example.com virtual host). If this configuration test doesn't turn up any errors, proceed to https://webmail.example.com. You will be presented with a login screen. Enter your username and password (the same as your system login). If all went fine you should see your mailbox!
If it does not work, check whether your browser has cookies enabled. Also verify whether your IMAP server is working correctly (in its logs, and/or with a regular IMAP mail client). You can also check your webserver logs for any error messages.
Happy SquirrelMailing!
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
listen_port 144
listen_address 127.0.0.1
Then in squirrelmail-configure:
2
A
5
type: 144
S
Q
Have fun :)
[ Parent | Reply to this comment ]
/usr/sbin/stunnel -P/tmp/ -c -d 1430 -r mail:993
Then I configured squirrelmail to use port 1430 for IMAP connections.
[ Parent | Reply to this comment ]
this is exactly what I'm looking for ... for few days
How can/Where do/ you "set a tunnel between the web server
and the imap server ???
[ Parent | Reply to this comment ]
20,000 users will all phone me and complain if it doesn't work properly, so I'm hoping it all stays smooth running ;)
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
That sounds like a fun project!
When I setup squirrelmail for my previous company I found that setting up addressbooks, and using some of the available plugins made the switch a much more positive experience for everybody.
Steve
-- Steve.org.uk
[ Parent | Reply to this comment ]
Yeah, we're using a few plugins already, and I've had to write a couple that I'll tidy up and submit back to the plugins repository (we currently use IMSP addressbooks, which no-one seems to use anymore ;)
So far I've had lots of positive feedback, which is great :D
[ Parent | Reply to this comment ]
Did you ever "tidy up" your IMSP address book plug-in for SquirrelMail?
I have to make a decision between SquirrelMail and IMP. I'd prefer SqM for various reasons, but if we can't get IMSP address book functionality it'll have to be IMP.
Whatever state your plug-in is in, and providing it's working, I would be interested in it. It's a real possibility that we would tidy it up for you and submit as a plug-in. Would it be possible to see the code?
Thanks and regards,
Neil Elliot
University of Bristol, UK.
[ Parent | Reply to this comment ]
dogayonvc@yahoo.com
I appreate all the help I can get. Thanks alot
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
Could someone write such an article for POP3pers? :)
[ Parent | Reply to this comment ]
[ Send Message | View Steve's Scratchpad | View Weblogs ]
POP3 webmail is much less popular than IMAP webmail. This is mostly because POP servers don't have a standard idea of "folders" in the same way that IMAP servers do.
That means you'd have all your mail in your INBOX all the time. There's also no obvious "sent" folders to view, etc.
That's probably the single biggest reason to switch to IMAP server, for remote access to a consistent view of your mail. Steve
-- Steve.org.uk
[ Parent | Reply to this comment ]
I've been using IMP for a couple of years now for webmail. It's part of the Horde framework, which includes a calendar, contact manager, task list, and loads of other addons. Best of all, the default theme is very pretty, which may not be very appealing to us geeks, but keeps the customers interested :)
It's a really solid webmail program, although probably with a little more overhead than SquirrelMail. One setup was for just over 20 000 users, and once ImapProxy was added it worked extremely well.
Sam Bashton
Bashton Ltd - Linux Consultancy
[ Parent | Reply to this comment ]
I agree.
HORDE/IMP is a little more heavy (in term of server load) than Squirrelmail, but manage large volume of mails really faster !
What's more, IMP as a modern interface ...
Users (thousands) was always complaining of the Squirrelmail response time, but this is no longer the case with IMP (3.0 and 4.0 versions are in production) : IMP, without any particular tuning, is ~ 10 times faster than squirrel with some huge mailboxes.
We do not use Imapproxy but http://eaccelerator.net/ helps a lot.
M
[ Parent | Reply to this comment ]
I looked at this, but people found the plainness of Squirrelmail preferable (from the responses I got), and testing on a slower server showed that Squirrelmail was a _lot_ faster for us..
I'd really thoroughly recommend using an IMAP proxy, since the number of connections made and then dropped, due to PHP-based webmails being unable to hold connections open across different scripts executing means that the load on the mail server can be greatly increased (without a proxy to help).
On a different note, Squirrelmail is getting a templated user interface in the current development version, so there will probably be a whole slew of "themes" which should make it possible to make it a lot prettier :)
[ Parent | Reply to this comment ]
checking for DOM EXSLT support... no
libxml is supposed to provide EXSLT support but PHP could not recognise it on recompilation even though libxml version was checked and matched that recommended.
I also have concerns that my users would have to authenticate to Horde as well as our IMAP server.
Any thoughts on the above issues would be welcome.
Slán
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
Thanks
[ Parent | Reply to this comment ]
Thanks!
[ Parent | Reply to this comment ]
It's to extrange.
If i upgtrade to uw-imapd 4:2001adebian-6 i cant connectg to imap server thru my thundrerbird but if I try to cvonnect thru my webmail server running Squirrelmail 1.5.0 i've an autenthication failure. If i downgrade to uw-imapd 7:2002edebian1-11sarge1 all works fine again...
Any Idea?
Squirrel mail is conigured to work with uw imap servers...
[ Parent | Reply to this comment ]
http://openwebmail.org/
Tristan Rhodes
[ Parent | Reply to this comment ]
I am confused how to create a User A/C in squirrelmail. Please help me.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
Debian Etch (Only)
Squirrelmail 1.4.9a
PHP Version 4.4.4-8
Everything seems to be working great. The configuration test comes back with flying colors. For my account and most everything works fine. For 2 people however they can look through each of their mail folders no problem except for the root (not super user) INBOX. Anyone experience a similar issue? Thanks in advance!
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
INDEX . INDEX. noneIndex and Index-dot both work fine... for 98% of the users. I am experiencing this issue with only 2 users. Both of these users have no issue opening and using their Maildir from within thunderbird. They are recent converts from outlook however and each of their .pst files were approximately 3gig.
Thanks for the suggestion. ;-)
[ Parent | Reply to this comment ]
If not then the ~/Maildir structure is not correct. Most likely you're missing the cur, new, and tmp directories in root of ~/Maildir.
It can also be that there are no e-mails in the INBOX. Did you have errors when you converted their .pst files to maildir? Outlook tends to do strange things and may corrupt a .pst file if its over 800MB. You may also want to get these users to stop using the e-mail system for storage and archiving. 3,000MB is very very large amount of space for one person's e-mail.
Try to empty out the problem mailboxes and see if it works. Remember to backup the contents first.
[ Parent | Reply to this comment ]
squirrelmail 1.4.9a-2
php 5
php5-cgi
php5-cli
php5-imap
libapache2-mod-php5
Any help much appreciated
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
Can someone post how they have squirrelmail/apache2 set up for this
Starting to get more ulcers!!
[ Parent | Reply to this comment ]
Although I appreciate your writeup; why write the following?:
Now to make the install web-accessible. With the configuration files you'll find an Apache configuration snippet you can edit and add to your Apache config. It's wise to add it to the configuration of Apache-SSL aswell, so your users can access their mailbox over a secure connection. After that, reload Apache. We should be done!
Can you not just write this up properly so people can complete the install without having to figure out what this means?
Thanks again for the write up, but now lost as to how to complete and have to look elsewhere.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
sudo cp /etc/squirrelmail/apache.conf /etc/apache2/sites-available/webmail.your_host_name.com
sudo a2ensite webmail.your_host_name.com
sudo /etc/init.d/apache2 reload
Now; open a a browser to http://your_host_name/squirrelmail
The default apache setup is to go there but you can change this to use webmail at the beginning in your VirtualHost section.
Cheers
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
Include /etc/squirrelmail/apache.conf
to my /etc/apache-ssl/httpd.conf file.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]
Although i am looking all over the internet on how to update an already excisting squirrelmail to a newer squirrelmail version.
Anyone can help here?
[ Parent | Reply to this comment ]