SMBs

DIY: Install SquirrelMail to allow web access to your Postfix server

SquirrelMail is an excellent way to access email on a Postfix-based mail server. Jack Wallen describes how to get it up and running on Ubuntu.

Postfix is one of the finest, most reliable mail servers available. Although it is limited to only email, once it's set up, it will serve you and your small business well. The one downside to Postfix is that it does not have a built-in web-based component. Fortunately, there is a handy system called SquirrelMail to stand sentinel as your SquirrelMail web interface.

SquirrelMail doesn't have a ton of bells and whistles such as a calendar, or tasks, or notes, but for someone who needs to enable employees to access their Postfix email server from the web, it's an ideal solution. Let's get SquirrelMail up and running on a Ubuntu server.

Requirements

  • A working Mail Transfer Engine (Postfix). (If you don't already have Postfix installed, follow the steps in my post DIY IT: Email server on a shoestring budget.)
  • A working (IMAP) Mail Delivery Agent (Dovecot). (If you have a working Postfix server, you most likely already have Dovecot working.)
  • A working Apache installation with PHP

Installing SquirrelMail

  1. Open a terminal window.
  2. Issue the command sudo apt-get install squirrelmail.
  3. Enter the sudo password.
  4. Accept any dependencies necessary.
  5. Let the installation complete.

Configuring SquirrelMail

SquirrelMail comes with an easy-to-use, command line configuration tool. To use the tool, open a terminal window and issue the command sudo squirrelmail-configure. When this tool opens (Figure A), you should set the Organizational Preferences, which allow you to set the organization's name, logo, and link. The most important menu option to focus on is Server Settings, where the following must be set (at a minimum):
  • A. Update IMAP Settings: localhost:143 (other)
  • B. Update SMTP Settings: localhost:25

These should work just fine as is; the only thing you might have to change is if you've configured Postfix or Dovecot to work on a non-standard port.

Figure A

SquirrelMail configuration tool

Next, go to General Settings (option 4 in the main menu) and then go to 11 (Server Side Sorting) and set that to True. If your IMAP server supports the SORT function, this will make for much more efficient sorting of email.

Once you have gone through all of the settings, be sure to select S (Save Data) from the main menu.

Configuring Apache

Now it's time to configure Apache so it knows where to locate the SquirrelMail installation. Follow these steps:

Step 1: A sample configuration for SquirrelMail is included in the installation. Open a terminal window and issue this command:

sudo cp /etc/squirrelmail/apache.conf /etc/apache2/sites-available/squirrelmail

Step 2: With that configuration in place, it has to be linked to the /etc/apache2/sites-enabled directory with this command:

sudo ln -s /etc/apache2/sites-available/squirrelmail /etc/apache2/sites-enabled/squirrelmail

Step 3: The Apache configuration needs to be reloaded with this command:

sudo /etc/init.d/apache2 force-reload

Test it out

In order to see if you have a working SquirrelMail installation, you need to point your browser to http://ADDRESS_OF_SERVER/squirrelmail. If you see the SquirrelMail login window (Figure B), congratulations -- you now have a working web-mail interface for your Postfix mail server! Figure B

Any user with an account on that machine should be able to log in.

Adding plugins

You can add plugins to extend the functionality of SquirrelMail. There is even a fully functional iCal compliant Calendar plugin that is easy to install.

  1. Download the plugin you want to use.
  2. Unpack the plugin in the /usr/share/squirrelmail/plugins/ directory.
  3. Check for a Readme or Install file within the unpacked plugin (each plugin has a different set of instructions).
  4. Open the squirrelmail-configure tool again and go to option 8 (plugins).
  5. Find the newly installed plugin and activate it.

Every plugin has a different set of installation instructions; oftentimes, those instructions are only dependencies. For the Shared Calendar plugin, the installation steps are as follows:

  1. Change to the /usr/share/squirrelmail/plugins/calendar/data directory.
  2. Issue the command cp config.php.sample config.php.
  3. Edit the config.php and set up the calendar administrators and make any adjustments necessary.
  4. Open the squirrelmail_config tool.
  5. Go to option 8.
  6. Enable the Shared Calendar plugin.

Many of the plugins will be just as easy to install, which means SquirrelMail is easily extendable.

Bottom line

I've been using SquirrelMail for years, and I have yet to find an easier web-based mail system to deploy and use. Your admins and your end users will thank you for installing SquirrelMail.

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

1 comments
sm00thb00th
sm00thb00th

ERROR Error connecting to IMAP server: localhost. 10 : I don't know why but I have all ports open I need. Bevor I have postfix and dovecot installed, on debian, from http://wyden.com/linux/mailserver/mailserver-mit-postfix-dovecot-postfixadmin-und-mysql-debian-etch . The installation seems to be ok but maybe I have a problem; in postfixadmin I can make a mailbox as well, but it says: (some red marked mailboxes)=maybe UNDELIVERABLE. I have no idea ... :-( [i] http://www.musicsealer.ch [/i] thanks