Install SquirrelMail on Ubuntu 16.04 or Debian 8
- Deprecated guides:
- Ubuntu 12.04
- Debian 7
Traducciones al EspañolEstamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
SquirrelMail is a webmail package, written in PHP, which supports both SMTP and IMAP protocols, and features cross-platform compatibility. SquirrelMail requires a web server with PHP to run properly. For this guide we’ll be using Apache 2. If you don’t already have Apache and PHP installed, you can check our LAMP Server on Ubuntu 16.04 or LAMP Server on Debian 8 guide.
This guide may involve or result in sending email. In an effort to fight spam, Linode restricts outbound connections on ports 25, 465, and 587 on all Linodes for new accounts created after November 5th, 2019. For more information, please see Sending Email on Linode.
NoteThis guide is written for a non-root user. Commands that require elevated privileges are prefixed withsudo
. If you’re not familiar with thesudo
command, you can check our Users and Privileges guide.
Installation
Update the system and install SquirrelMail from the repositories.
First, install the most recent system updates:
sudo apt-get update sudo apt-get upgrade
Install SquirrelMail:
sudo apt-get install squirrelmail
Configure the Virtual Host
To access SquirrelMails’s web interface, create and configure a copy of its default virtual host configuration file in the Apache directory. Configure the settings in the copied file to match your Linode and domain settings.
SquirrelMail provides a default configuration file for Apache in
/etc/squirrelmail/apache.conf
. Copy this configuration file into yoursites-available
folder with the command:sudo cp /etc/squirrelmail/apache.conf /etc/apache2/sites-available/squirrelmail.conf
Edit the configuration file to uncomment the
<VirtualHost 1.2.3.4:80>
block by removing the pound symbol (#
), as shown below. Edit the IP and ServerName to match your Linode and domain settings:- File: /etc/apache2/sites-available/squirrelmail
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
Alias /squirrelmail /usr/share/squirrelmail <Directory /usr/share/squirrelmail> Options FollowSymLinks <IfModule mod_php5.c> php_flag register_globals off </IfModule> <IfModule mod_dir.c> DirectoryIndex index.php </IfModule> # access to configtest is limited by default to prevent information leak <Files configtest.php> order deny,allow deny from all allow from 127.0.0.1 </Files> </Directory> # users will prefer a simple URL like http://webmail.example.com <VirtualHost *:80> DocumentRoot /usr/share/squirrelmail ServerName squirrelmail.example.com </VirtualHost> # redirect to https when available (thanks omen@descolada.dartmouth.edu) # # Note: There are multiple ways to do this, and which one is suitable for # your site's configuration depends. Consult the apache documentation if # you're unsure, as this example might not work everywhere. # #<IfModule mod_rewrite.c> # <IfModule mod_ssl.c> # <Location /squirrelmail> # RewriteEngine on # RewriteCond %{HTTPS} !^on$ [NC] # RewriteRule . https://%{HTTP_HOST}%{REQUEST_URI} [L] # </Location> # </IfModule> #</IfModule>
Note
If Apache is serving other virtual hosts you may need to adjust them and/or this configuration file to prevent any conflicts. If you’re running Apache solely for SquirrelMail, you may still want to remove the default virtual host fromsites-enabled
.Enable the new virtual host:
sudo a2ensite squirrelmail.conf
Reload Apache:
sudo systemctl reload apache2.service
You should now be able to see SquirrelMail’s default login page in your browser after navigating to your Linode’s IP address or domain:
Configure SquirrelMail
Before using SquirrelMail for the first time, configure it to access your mail server. SquirrelMail provides a tool called squirrelmail-configure
, an interactive interface which edits the /etc/squirrelmail/config.php
file for you with the input you provide.
Launch the
squirrelmail-configure
application:sudo squirrelmail-configure
This will bring up the menu shown below:
There are many options to adjust here; too many for the scope of this guide. The only settings required to make SquirrelMail work are the
Server Settings
. Enter 2 to bring up the Server Settings submenu:If your mail server is on the same Linode as your SquirrelMail installation, you may not need to make any adjustments to the default settings. Otherwise, adjust the Domain, IMAP, and SMTP settings to match the mail server you want to connect to. You can find additional configuration tips for this section from SquirrelMail’s official documentation.
Note
If your email server usesSTARTTLS
encryption, as our Email with Postfix, Dovecot, and MySQL guide does, You will not be able to authenticate using this version of Squirrelmail. Version 1.5.1 and higher can useSTARTTLS
, but are in development and not available in the main repositories. You can download the latest build from Squirrelmail’s website.When done, press
S
to save your changes, then press Q to quit.
Sign In to the Web Interface
At this point you should be able to log in to the SquirrelMail Login page using your email credentials. Navigate in your web browser to the Linode’s IP address, or domain name depending on how you’ve configured the virtual host:
The interface layout follows standard email convention; all common functions should be easily accessible:
Once you’re finished, you can sign out using the link in the upper-right corner. Always remember to sign out if you’re using a public computer.
More Information
You may wish to consult the following resources for additional information on this topic. While these are provided in the hope that they will be useful, please note that we cannot vouch for the accuracy or timeliness of externally hosted materials.
This page was originally published on