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!

 

 


Posted by sno (62.254.xx.xx) on Sun 31 Jul 2005 at 22:38
[ View Weblogs ]
i use squirrelmail on a small server and it works great, no problems with it at all and there are some handy plugins.

[ Parent | Reply to this comment ]

Posted by shufla (83.30.xx.xx) on Mon 1 Aug 2005 at 10:31
One nice thing: apt-cache show imapproxy

[ Parent | Reply to this comment ]

Posted by shufla (83.30.xx.xx) on Mon 1 Aug 2005 at 10:52
BTW. After installation tweak some settings in /etc/imapproxy.conf:

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 ]

Posted by lindenle (69.212.xx.xx) on Mon 1 Aug 2005 at 14:38
[ View Weblogs ]
We run squirrel mail on the web server and it connects to our mail server via IMAP. However our mail server only allows IMAP SSL connections so I set up a tunnel between them using stunnel. Now everything works great....

/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 ]

Posted by Anonymous (193.49.xx.xx) on Tue 19 Dec 2006 at 18:03
Excellent!

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 ]

Posted by legooolas (144.173.xx.xx) on Mon 1 Aug 2005 at 15:21
I work in the IT Services department of a university in the UK, and I'm in the process of switching the current antiquated proprietary webmail system to Squirrelmail, and it looks like everything is going pretty smoothly so far :)

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 ]

Posted by Steve (82.41.xx.xx) on Mon 1 Aug 2005 at 17:49
[ 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 ]

Posted by legooolas (144.173.xx.xx) on Tue 2 Aug 2005 at 09:25
> ...using some of the available plugins

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 ]

Posted by Anonymous (137.222.xx.xx) on Fri 30 Jun 2006 at 17:16
Legooolas,

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 ]

Posted by nvwoti (70.104.xx.xx) on Tue 2 Aug 2005 at 17:16
Wondering if any nice people can help me set this up I tried to follow the article and it was a no go. If so please email me
dogayonvc@yahoo.com

I appreate all the help I can get. Thanks alot

[ Parent | Reply to this comment ]

Posted by grimoire (82.69.xx.xx) on Thu 11 Aug 2005 at 13:01
Why not tell us what problems you're having with SquirrelMail and see if we can help you here?

[ Parent | Reply to this comment ]

Posted by nvwoti (70.104.xx.xx) on Thu 11 Aug 2005 at 16:56
I thought I followed all the directions and Im totaly lost I cant tell what works and what doesnt it would be tons faster for me to work with someone 1-1 via instant messenger than it would be posting back and fourth, but thank you I appreate your time in helping. I am unable to reach the server I have no idea if anything is setup right.

[ Parent | Reply to this comment ]

Posted by Anonymous (77.246.xx.xx) on Thu 25 Nov 2010 at 12:10
i successfuly setup my squirrelmail and its working fine the problem is when internet is down i cannot connect to my local mail server

[ Parent | Reply to this comment ]

Posted by Anonymous (213.77.xx.xx) on Tue 2 Aug 2005 at 19:23
And what about a POP3-based webmail? Is there any nice working app to apt-get install it?
Could someone write such an article for POP3pers? :)

[ Parent | Reply to this comment ]

Posted by Steve (82.41.xx.xx) on Tue 2 Aug 2005 at 19:41
[ 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 ]

Posted by samb (62.252.xx.xx) on Wed 3 Aug 2005 at 05:00
I've never really got on with squirrelmail, or rather my clients haven't - every time I used to demo it to them they'd all complain it was too plain.

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 ]

Posted by Anonymous (194.250.xx.xx) on Wed 3 Aug 2005 at 08:52

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 ]

Posted by legooolas (144.173.xx.xx) on Wed 3 Aug 2005 at 14:15
> Horde/IMP

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 ]

Posted by Seos (140.203.xx.xx) on Wed 3 Aug 2005 at 14:22
I've been looking at a number of webmail packages including Squirrelmail. Squirrelmail has alot going for it but I am worried about load issues. I looked at IMP but had a problem with the install. All the prerequisites were installed and configured however the final PHP recompilation repeatedly fails on:

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 ]

Posted by kink (143.121.xx.xx) on Wed 3 Aug 2005 at 14:44
I wonder why you are concerned with load issues. SquirrelMail is used by major institutions, for example Dutch ISP XS4ALL. As with any service it depends on choosing the factors right, but this goes for any webmail client. I wouldn't say that IMP is more efficient than SquirrelMail per se. A good start is the right choice of IMAP backend. Never use UW IMAP. Servers like Cyrus or Dovecot can can be really fast. You should also make use of the suggested IMAPproxy.

[ Parent | Reply to this comment ]

Posted by Anonymous (61.90.xx.xx) on Tue 4 Oct 2005 at 09:39
Anyone help me to setup secure_login plugin?
Thanks

[ Parent | Reply to this comment ]

Posted by Anonymous (24.178.xx.xx) on Sat 8 Oct 2005 at 02:27
Good tutorial. I got this to work no problems and most importantly, you covered everything. Not just configuration, but making it web accessible. The tutorials at Squirrelmail should have a link here or post this on their site.
Thanks!

[ Parent | Reply to this comment ]

Posted by Anonymous (80.58.xx.xx) on Fri 14 Oct 2005 at 12:50
I've a little program to my production server running uw-imapd amb my squirrelmail.
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 ]

Posted by Anonymous (137.190.xx.xx) on Mon 24 Oct 2005 at 21:03
Everyone should take a look at OpenWebmail when considering a webmail system.

http://openwebmail.org/

Tristan Rhodes

[ Parent | Reply to this comment ]

Posted by babmoll77 (46.23.xx.xx) on Tue 30 Jul 2013 at 06:58
How do I get or sign up for an http://openwebmail.org/ account. Please put me through?


Bab

[ Parent | Reply to this comment ]

Posted by Anonymous (202.79.xx.xx) on Tue 18 Jul 2006 at 12:17
I have done all whaterver mentioned in this articel. But I am getting problem while login. I loged in as root (linux system root user) but I am getting this error "ERROR : Connection dropped by imap-server".
I am confused how to create a User A/C in squirrelmail. Please help me.

[ Parent | Reply to this comment ]

Posted by Anonymous (145.99.xx.xx) on Tue 18 Jul 2006 at 12:31
SquirrelMail does not create user accounts. It uses the standard unix accounts present on your IMAP server. That error seems to come from Courier IMAP. It does that when a new user doesn't have a maildir yet. That's easily solvable by sending a test mail to that user so the Maildir will be created.

[ Parent | Reply to this comment ]

Posted by Anonymous (196.3.xx.xx) on Fri 24 Nov 2006 at 21:43
thanks for the email. can u help me create this email account. the user name: danaartwell, then forward to my email: danaartwell@yahoo.co.uk. l did like to use Cpanel to open it.

[ Parent | Reply to this comment ]

Posted by geoff (220.233.xx.xx) on Thu 30 Nov 2006 at 08:49
This is a good tute! I have been looking for a similar one on creating a user registration or sign up system for SquirrelMail. I have not been able to find examples on how to do this. Any ideas?

[ Parent | Reply to this comment ]

Posted by Anonymous (69.250.xx.xx) on Sun 10 Dec 2006 at 02:41
As posted above, the webmail does not create users but it uses the ones used in the program used *Courier, mailq, etc* .. you can start by adding the folder "Maildir" to your /home/username . Hope that helps. <admin@pyroman.us>

[ Parent | Reply to this comment ]

Posted by Anonymous (86.97.xx.xx) on Mon 11 Jun 2012 at 20:03
Thanks for the tip.I can send email but i cannot receive any mails.Could you help me.I have been using postfix and dovecot for mail server.

[ Parent | Reply to this comment ]

Posted by mindmerge (216.185.xx.xx) on Thu 22 Feb 2007 at 20:08
[ View Weblogs ]
Specs:
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 ]

Posted by mindmerge (216.185.xx.xx) on Thu 22 Feb 2007 at 20:16
[ View Weblogs ]
I did forget a crucial piece of information. I am using Courier for imap. I've done some scouring of the web and have attempted using different default prefixes. None of the prefixes have solved this particular issue. At this point I am slugging through the horde/imp installation and configuration. I would like to get squirrelmail working for these 2 users... however at this point my time is becoming an issue.

[ Parent | Reply to this comment ]

Posted by kink (145.99.xx.xx) on Thu 22 Feb 2007 at 20:20
Have you set "courier" as the IMAP server type in your configuration?

[ Parent | Reply to this comment ]

Posted by mindmerge (70.166.xx.xx) on Fri 23 Feb 2007 at 04:06
[ View Weblogs ]
yes ;-) I have also attempted to use numerous default indexes such as:
INDEX
.
INDEX.
none
Index 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 ]

Posted by Anonymous (202.178.xx.xx) on Sat 28 Apr 2007 at 16:22
Can they access the INBOX via IMAP?
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 ]

Posted by daryl (60.234.xx.xx) on Thu 12 Jul 2007 at 10:21
[ View Weblogs ]
Having trouble installing Squirrelmail on Etch. Trying to login but a box asking to download php or save to disk. On the server my configurations are,
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 ]

Posted by kink (145.99.xx.xx) on Thu 12 Jul 2007 at 10:26
PHP is probably not enabled in Apache. Check whether you've properly "a2enmod php5". In any case it's not really on topic for SquirrelMail but rather for PHP itself.

[ Parent | Reply to this comment ]

Posted by daryl (60.234.xx.xx) on Thu 12 Jul 2007 at 11:05
[ View Weblogs ]
Good news, finally got the bugger going! Deleted and purged libapache2-mod-php5 and then reinstalled now everything ok

[ Parent | Reply to this comment ]

Posted by daryl (60.234.xx.xx) on Thu 19 Jul 2007 at 10:30
[ View Weblogs ]
Having trouble with redirecting traffic to https.
Can someone post how they have squirrelmail/apache2 set up for this

Starting to get more ulcers!!

[ Parent | Reply to this comment ]

Posted by Anonymous (189.133.xx.xx) on Fri 30 Nov 2007 at 15:49
Hi,

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 ]

Posted by kink (85.223.xx.xx) on Sat 1 Dec 2007 at 23:38
I didn't write it up because there are many ways to do it, all depending on your existing apache config and wishes. But your example below is certainly one of the ways!

[ Parent | Reply to this comment ]

Posted by Anonymous (189.133.xx.xx) on Fri 30 Nov 2007 at 16:28
Apologies for last rant; for those on Apache 2; to add squirrelmail do the following:

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 ]

Posted by Anonymous (217.194.xx.xx) on Thu 22 May 2008 at 19:23
I had the same reaction/rant. I still do believe that it should be written in the article that "hey, there's one way to do it written down there, in the comments". It would have helped me avoiding this "grumph" noise I make when I'm disappointed or frustrated...

[ Parent | Reply to this comment ]

Posted by Anonymous (151.214.xx.xx) on Thu 10 Jan 2008 at 09:18
How do you configure debian's apache-ssl to use squirrelmail? I've got it configured with the script, and I've installed php3-cgi, php4-cgi and php5-cgi and all apache-ssl does is serve up the php files themselves, it doesn't try to execute them. I've added:

Include /etc/squirrelmail/apache.conf

to my /etc/apache-ssl/httpd.conf file.

[ Parent | Reply to this comment ]

Posted by Anonymous (81.157.xx.xx) on Wed 13 Feb 2008 at 09:27
Many thanks for your guide, I had SquirrelMail running in minutes :-)

[ Parent | Reply to this comment ]

Posted by Anonymous (85.72.xx.xx) on Fri 25 Sep 2009 at 14:03
Nice,simple and helpful guide.
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 ]

Posted by Anonymous (50.192.xx.xx) on Tue 18 Sep 2012 at 20:10
I believe that I followed all of the default choices of setting up my mysql / postfix / dovecot email server on my Debian 7.0 Wheezy build. When I installed squirrelmail the left margin displayed a large red error of
Reason Given: Client tried to access nonexistent namespace. (Mailbox name should probably be prefixed with: INBOX.)
So I did a little reading and pieced together a solution that worked.

In the SquirrelMail Configuration File (/etc/squirrelmail/config.php), the $default_folder_prefix the variable was left empty, so I gave it what it asked for,

$default_folder_prefix = "INBOX."
Restarted, and no more error message and now a list of my folders were in the margin.

HTH

By the way, I tried to join this group, however at the time of this writing I was still having issues with my new DNS, so hopefully I can get my new account of garytayl & new DNS working soon.

[ Parent | Reply to this comment ]

Sign In

Username:

Password:

[Register|Advanced]

 

Flattr

 

Current Poll

What do you use for configuration management?








( 156 votes ~ 0 comments )