Installing Squirrelmail

SquirrelMail is a standards-based webmail package written in PHP4. It includes built-in pure PHP support for the IMAP and SMTP protocols, and all pages render in pure HTML 4.0 (with no Javascript) for maximum compatibility across browsers. It has very few requirements and is very easy to configure and install. SquirrelMail has a all the functionality you would want from an email client, including strong MIME support, address books, and folder manipulation. For more information, Please see

To install squirrelmail port, run the following command:

# cd /usr/ports/mail/squirrelmail
# make install clean

This will install Squirrelmail in /usr/local/www and install all required modules. What we are going to do now is symlink the webmail installation folder with the one in your httpdocs folder. The correcy way to do this is ln -s source_file [target_file].

# ln -s /usr/local/www/squirrelmail/ /usr/local/www/apache22/webmail

Configuring Squirrelmail

Now we need to configure squirrelmail. Run the following commands to get into setup mode: (Change the /path/to/webmail/ to where your squirrelmail folder is)

# cd /path/to/webmail/config
# ./

You will be presented with a menu. Under 1 - Organization Preferences, Any one of the setings inside this window are optional. When you are done, hit S to save and then hit Enter and then hit R to go back to the Main Menu.

Now we want to go to 2 - Server settings. Hit 1 for Domain and hit Enter on the keyboard. You can type the name of the server or the local IP or public IP, whichever you prefer. If your mailserver is behind a router/firewall, I use the local IP. If you are on the public side of things, the hostname or the static IP will work fine. If you are using a dyndns service like, I would highly suggest using the local ip and putting your qmail server behind a router/firewall.

Under Server settings we want to use the following. Please change x.x.x.x to the IP of your mail server:

1.  Domain                 : x.x.x.x
2.  Invert Time            : false
3.  Sendmail or SMTP       : Sendmail

A.  Update IMAP Settings   : localhost:143 (other)
B.  Change Sendmail Config : /var/qmail/bin/sendmail

Hit Y and then hit Enter. Hit S to save and then hit Enter again. Hit Q to quit and exit the menu.

Now lets setup ownership for squirrelmail attachments:

# chown www:www /var/spool/squirrelmail

And then setup php.ini. Do an ls -la /usr/local/etc and check for an existing php.ini file. If you're sure you have it skip to the next step below. If not, please do the following:

# cd /usr/local/etc
# cp php.ini-recommended php.ini

Just to make sure Squirrelmail is working okay, we will want to run the config test. Do this by going to the following url. http://your-squirrelmail-location/src/configtest.php. Replace the your-squirrelmail-location with your ip or your hostname. This will tell you if squirrelmail is setup correctly. If you see this:

ERROR: Error connecting to SMTP server "localhost:25".Server error: (0) Unknown error: 0

This is okay. The server is able to accept messages on port 25 for anything in locals or rcpthosts or relaying via TLS. When you are completed with installing squirrelmail you should install the change_pass-2.7-1.4.x plugin so you can change passwords with courier.

Installing Qmailadmin