How to set up RainLoop webmail in Ubuntu server

Webmail is undoubtedly an essential part of any mail server. While native email client software has typically more features compared to webmail services, accessing IMAP or SMTP server ports via an email client from outside of the trusted network can sometimes be tricky. Moreover, while you need a designated workstation, laptop, or mobile device to use an email client, you can use webmail services from anywhere as long as you have an Internet connection.

This tutorial will focus on setting up RainLoop webmail on an Ubuntu server running Apache. RainLoop is PHP-based webmail, and has the following features.

  • Supports apache, nginx and other web servers.
  • Standard interface supplemented with a gallery of themes to select from.
  • Free to use for personal and non-profit projects.

As of this writing, there is no support for email filtering and out-of office auto replies yet.

Install RainLoop on Ubuntu Server

First of all, necessary packages are set up in the server.

# apt-get install wget unzip apache2 php5 php5-mysql libmysqlclient15-dev mysql-server poppassd

Next, RainLoop is downloaded and installed.

# mkdir /var/www/webmail
# cd /var/www/webmail
# wget
# unzip
# rm rainloop-*.zip

Then necessary permission is set.

# cd /var/www/webmail
# find . -type d -exec chmod 755 {} \;
# find . -type f -exec chmod 644 {} \;
# chown -R www-data:www-data /var/www/webmail

We are almost ready to use RainLoop. Final adjustments are made through the admin panel, which will be described next.

First-Time Configuration via Admin Panel

Most configuration parameters can be adjusted with a user-friendly admin panel. The admin panel is accessible using the following credentials.

  1. URL: http://IP/webmail/?admin
  2. user: admin
  3. Pass: 12345

Of course it is recommended to change the default password as soon as possible. We will use the admin panel to adjust the following settings.

Add Domains

Domain settings is available at Admin Panel > Domains > Add Domain Page. The recommended server IP is localhost i.e., Based on the server configuration, RainLoop can be configured to use IMAP/IMAPS or SMTP/SMTPS. Also, make sure that the 'Use short login form' checkbox is enabled.

Settings can be verified using the ‘Test Connection’ button.

Enable Contacts

The contacts feature needs database support. We will be using MySQL for enabling contacts. The database required by RainLoop can be created manually as follows.

# mysql -u root -p
mysql> create database rainloop;
mysql> exit;

Now this feature can be enabled from Admin Panel > Contacts page.

Once again, settings can be checked using the ‘Test’ button.

Enable Password Changing Plugin

Email accounts in most Linux-based mail servers are actual users of the operating system with their own UID and GID. Therefore, changing the password of these accounts has been tricky in the past. Fortunately, today there are tools available that can get the job done. One such tool is poppassd.

The first step is to install poppassd on the server, which can be done with apt-get.

# apt-get install poppassd

Next, to allow RainLoop to use poppassd, install RainLoop plugin for poppassd from Admin Panel > Packages page.

Finally, the poppassd plugin can be enabled from Admin Panel > Plugins page.

Now that all the parameters are set, a user can log in by providing their credentials as shown in the screenshot.

  • URL: http://IP/webmail
  • user: user@domain
  • pass: password

Hope this helps.

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

The following two tabs change content below.
Sarmed Rahman is an IT professional based in Australia. He writes tutorial articles on technology every now and then from a belief that knowledge grows through sharing. During his free time, he loves gaming and spending time with his friends.

21 thoughts on “How to set up RainLoop webmail in Ubuntu server

  1. I tried to install it but gived this error on index.php:

    Fatal error: Uncaught exception 'LogicException' with message 'Illegal value passed (no array or string given)'

  2. Shouldn't chown -R be # chown www-data:www-data /var/www/webmail -R, otherwise it should give you an error that -R no such user? also
    unzip - small R and same on the next line.

  3. After installing Rainloop. whenever I try to log in to any user account I get a standard page saying that an error occurred. While digging through my apache logs I find the following error message.

    PHP Fatal error: Class 'MailSo\\Log\\Enumerations\\Type' not found in /var/www/webmail/rainloop/v/ on line 54, referer:

    I'm not well versed in PHP, and would appreciate any help that you can offer.

  4. Fixed it.

    /var/www/webmail/rainloop/v/ line 54 should read "public function Type(\RainLoop\Account $oAccount, $sPrevPassword, $sNewPassword)"
    not "public function ChangePassword(\RainLoop\Account $oAccount, $sPrevPassword, $sNewPassword)"

    It was trying to call a function that didn't exist.

  5. Is there a tutorial on how to install Rainloop on CentOS? The commands are slightly different. I am doing all the steps until I get to the chown command. That above command is not working on my server. Can someone help me please?

Leave a comment

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