Integration of squirrelmail with postfix server on Linux

Squirrelmail With Postfix Server

         This guide helps to install and configure squirrelmail with postfix server. I have already explained or demonstrated the process for installing postfix server on a local Linux system.
If you still not install postfix server then follow below link which gives you a complete understanding of postfix server.

Once you install postfix server then follow below installation and configuration steps for Squiremail. This installation is tested on Ubuntu/Mint/Debian distros.

Requirements to run Squiremail:

  • Postfix 
  • dovecot-impad
  • dovecot-pop3d
  • squirrelmail

Let's start with installation and configuration process for squirrelmail with postfix.

1. Install dovecot

dovecot is used as Mail Delivery Agent[MDA] which helps to deliver the emails from/to the mail server. To install dovecot on the system run below commands.

$ apt-get install dovecot-imapd dovecot-pop3d

At the time of installation process, you will be asked if you want to "create Self-Signed SSL certificate" then choose "YES".

squirrelmail1

Next asked you to enter Hostname to use in the SSL certificate. Refer below screenshot.

screen-squir2

2. Restart dovecot service

After completing the installation, restart the dovecot service. Run below restart command,

$ service dovecot restart

3. Install Squirrelmail

Squirrelmail is basically email server that will help you to manage emails on the server. It will provide you a web interface to handle the emails. It will also modify using more custom modules and themes which are easily available on the web. It is very simple to install because the package is already available on repo. Run below command to install Squirrelmail.

It will provide you a web interface to handle the emails. It will also modify using more custom modules and themes which are easily available on the web. It is very simple to install because the package is already available on repo. Run below command to install Squirrelmail.

It will also modify using more custom modules and themes which are easily available on the web. It is very simple to install because the package is already available on repo. Run below command to install Squirrelmail.

It is very simple to install because the package is already available on repo. Run below command to install Squirrelmail.

Run below command to install Squirrelmail.

$ apt-get install squirrelMail

4. Configure SquirrelMail

To configure Squirrelmail on a server run the below configuration command which will give you "configuration Menu".

$ squirrelmail-configure
screen-squir3

From the menu, options choose no. 2 for server settings. You will be prompted like below screen.

squirrelmail4

Now choose option 1 to set up or change domain name & add your domain name (e.g. example.com)

squirrelmail5

Once the domain change goes back to the main menu by using "R" option. Now enter the "4" option which will help to configure general options

squirrelmail6

Now check for "Allow server-side sorting" from above screen list. Enter no. 11 & change it from "false" to "true" by using "y".
Hit Enter and then hit "s" to save configuration changes. come out of the main menu using "Q".

Here we have completed the SquirrelMail configuration.

5. WebInterface Configuration

Now for web interface just copy "apache2.conf" file from "/etc/squirrelmail" directory to "sites-available" directory.

Use below copy command.

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

After copying conf file, enable SquirrelMail.conf file using "a2ensite" command.

$ a2ensite squirrelmail.conf

6. Restart Apache Service

After the web server related configuration changes run apache restart command.

$ service apache2 reload

You can now access the mail server web interface using URL "http://domainname.com/squirrelmail".

squirrelmail7

7. Create Mail user

To access the SquirrelMail you need to create a user. For creating user use below "adduser" command. I have created testuser for accessing SquirrelMail for testing.

$ adduser testuser

8. Go to the login page and enter the created username & password. You will be getting below error then use provided a solution to resolve this issue.

Error: Opening INBOX failed: Mailbox isn't selectable

Solution:

vim /etc/dovecot/conf.d/10-mail.conf
#Comment default mail_location line and add below new mail_location line,
#mail_location = mbox:~/mail:INBOX=/var/mail/%u
mail_location = maildir:~/Maildir

restart the dovecot service using below command,

$ /etc/init.d/dovecot restart

Now login again with credentials.

squirrelmail8

You can now able to send email through SquirrelMail. Make sure receive emails on SquirrelMail you need to provide authorized domain name details.

If you face error then check log file "tail -f /var/log/mail.log".

Leave a Reply

Your email address will not be published. Required fields are marked *