Part 13 - Installing Squirrelmail

Now that we have Qmail running with IMAP, we can install a webmail client to make mail accessible via a web browser. My choice for this was Squirrelmail. Squirrelmail is both easy to install and it has lots of nice plugins to broaden its abilities. I know that a lot of people out there like to use Horde. I like Horde myself and I've installed it on my Qmail server alongside Squirrelmail. However, Horde is a major pain in the ass to install. Anyone who's ever intalled it will tell you that. I just don't want to take the responsibility for it on this site. Some people also like to use SQwebmail. No offense, but I don't like SQwebmail.

Anyway, let's install Squirrelmail...

The first order of business to make sure PHP is installed and correctly configured. So let's get that out of the way...

In order for Squirrelmail to work correctly, you'll need to check a couple things about your PHP installation:

1. First of all, make sure some rendition of PHP 4 is installed. If it's not, kick yourself in the ass and then go install it. Sorry, I'm not going to give a PHP installation tutorial. To be safe, you will want the following config options to be active in your PHP installation.


If you're running Redhat, however, PHP can be easily installed as an RPM either manually or with "up2date". A default RPM installation of PHP will usually cover you. The only extra RPMs you'll want to install is "php-mysql".

2. Make sure you have PHP uploads turned ON. This is done by editing a line in your php.ini file. The location of the php.ini file can vary, but it's usually located at /etc/php.ini. If it's not, don't panic. Just run the old "locate php.ini" command. ;) Here's the line you will want to check/edit:

file_uploads = On

That's it for the PHP setup. Now let's download Squirrelmail...

You can download the latest stable version of Squirrelmail from:

I recommend downloading the .tar.gz version of the latest release.

Now change directories to the web directory of the website you want to serve Squirrelmail off of. In my case, I used /var/www/html

tar zxvf /path/to/squirrelmail-x.x.x.tar.gz (enter whatever version you downloaded)

Now rename the untarred folder to something more friendly...

mv squirrelmail-x.x.x webmail

And now let's configure Squirrelmail...

mkdir /var/sqattachements

chown -R apache:apache /var/sqattachements (or whatever user apache runs as)

cd webmail

chown -R apache:apache data (or whatever user apache runs as)

cd config


This will run the Squirrelmail setup script which will allow you to customize the installation as well as set your server settings. Most of the important settings are in area #2, which is dubbed "Server Settings". Here are the specs I recommend:

1. Domain : (Enter the IP of your server here. Don't be an idiot and actually use
2. Invert Time : false
3. Sendmail or SMTP : SMTP

IMAP Settings
4. IMAP Server : localhost
5. IMAP Port : 143
6. Authentication type : login
7. Secure IMAP (TLS) : false
8. Server software : other
9. Delimiter : detect

SMTP Settings
4. SMTP Server : localhost
5. SMTP Port : 25
6. POP before SMTP : false
7. SMTP Authentication : login
8. Secure SMTP (TLS) : false

Depending on what version of Squirrelmail you are installing, the setup menu may differ slightly. But you get the idea. If you like, there a several other features of Squirrelmail you can customize that, while not critical, are sometimes fun. Also, check out Squirrelmail's site for tons of cool plugins. Make sure you save all settings before exiting the configuration menu.

Once you've configured Squirrelmail to your liking, it's time to configure Apache to serve our new webmail interface...

Notice: The following Apache configuration entry below will show you what I MYSELF have for my server's Apache configuration. Apache configurations will vary, so this may or may not work for you. Also, this is not meant to be a lesson in how to configure Apache. If you are confused about configuring Apache, I would reccomend that you STOP here and go find a tutorial on Apache. Please do not email me asking me to explain Apache configuration methods to you. I am currently working on a comprehensive Apache tutorial site (, but until it's complete, you will need to seek Apache help and advice elsewhere.

There are probably about a million ways to do this, but here's what I do. I edit the httpd.conf Apache configuration file and add the following block:


ServerAlias mail.*
ServerAdmin [email protected]
DocumentRoot /var/www/webmail

Here's a breakdown of what's above:

<VirtualHost> - This indicates I'm setting up my mail interface as a virtual host, rather than IP based. Obviously, you're going to want to replace with the IP address of your web server. Additionally, what you have here may vary from server to server and is dependent on how you have your Apache configured. Be cautious!

ServerName - The official name of the webmail server virtual host.

ServerAlias mail.* - This line establishes a wildcard serveralias called mail.*. With this setup, any domain that is pointed to your server and that has an A record called "mail", will be able to get to the webmail interface by simply going to This is a pretty cool little feature and makes accessing the webmail interface easy for all of your users.

ServerAdmin [email protected] - The server administrative contact. This is not required, but I like to include it.

DocumentRoot /var/www/webmail - The document root of your webmail interface. This will vary, depending on where you chose to install Squirrelmai. In this example, you can see that I installed it at /var/www/webmail

</VirtualHost> - The closing tag to the virtualhost.

Make sure you restart Apache after making the above changes.

Ok, now that Apache is all configured, let's test the new webmail interface...

We'll sign in with the postmaster account under the domain you should have created earlier using Vqadmin...

Username: [email protected]

Password: your_password

If all has gone well, Squirrelmail should log your right into your account! From here you will be able to both send and receive mail as well as a host of other additional functions. Again, Squirrelmail has tons of really cool plugins, and you can check them out at Squirrelmail's plugins page. Installing the plugins is pretty easy and their site can help you out. Now that was nice and painless, wasn't it? If I had tried to explain installing Horde instead, you would probably be holding a gun to your head right now, wishing for quick end to the misery. OK, I'm only kidding. :)

Now, I'm going to cover the addition of 1 Squirrelmail plugin. Keep in mind, there are tons of other plugins available. We're going to install the "change_pass" plugin which will allow our mail users to change their passwords from the Squirrelmail interface. This is made possible by the installation of Courierpassd that we did when we installed Courier-imap in the previous step.

So here goes...

cd /path/to/squirrelmail_directory/plugins (example: cd /var/www/webmail/plugins)

Download the module...


Unpack the module...

tar zxvf change_pass-2.7-1.4.x.tar.gz

Remove the tarball of the module...

rm -rf change_pass-2.7-1.4.x.tar.gz

Now let's go and add the module into Squirrelmail...

cd /path/to/squirrelmail_directory/config

Run the Squirrelmail configuration tool...


Choose the option for "plugins". On my version of Squirrelmail, this was option 8. Once you are in the modules menu you should see the "change_pass" module on the list of available, but inactive, modules. You can add the "change_pass" module by simply typing the number associated with the module and then hitting enter. Once the module appears on the active module list, go ahead and save the configuration changes and then exit out of the configuration tool.

Alright! You should be all set now. All that's left to do log into Squirrelmail and try out the password change tool!

That's it for Squirrelmail. Now let's move on to the next step.


Proceed to Part 14


Color Coded Qmail Installation Key
Regular Black Text 
 Qmail installation notes and summaries by the author. Me talking.
Bold Black Text 
 Commands to be run by you, the installer.
Bold Maroon Text 
 Special notes for Redhat 9 users.
Bold Red Text 
 Vital and/or critical information.
Regular/Bold Purple text 
 Denotes helpful tips and hints or hyperlinks.
Regular Orange Text 
 Command line output.

Regular green text 

 Denotes the contents of a file or script.
home | about | the installation | utilities | faq | contact | journal | mailing list | list archive | forum | links | donatemerchandise
This mirror last modified: Thursday, August 9th, 2012 15:58:37 CEST
The Rocks Project