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.
Next, RainLoop is downloaded and installed.
# cd /var/www/webmail
# wget http://repository.rainloop.net/v1/rainloop-1.6.3.706-e3c14e17bc4370a1561bcc68d1d494fd.zip
# unzip rainloop-1.6.3.706-e3c14e17bc4370a1561bcc68d1d494fd.zip
# rm rainloop-*.zip
Then necessary permission is set.
# 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.
- URL: http://IP/webmail/?admin
- user: admin
- 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., 127.0.0.1. 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> 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.
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!

Great Tuto. RainLoop seems better then squirrelmail, roundcube, webmail etc. Keep up the good work.
True. The interface is far better than the ones we used in back in BOL :D
The RainLoop is an open source application?
Open source; free to use for personal and non-profit projects. Requires permission for commercial use.
please fix:
#wget http://repository.Rainloop.net/v1/Rainloop-1.6.3.706-e3c14e17bc4370a1561bcc68d1d494fd.zip
-->
#wget http://repository.rainloop.net/v1/rainloop-1.6.3.706-e3c14e17bc4370a1561bcc68d1d494fd.zip
Done. Thanks.
Thanks.
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)'
It was related to eAccelerator. I disabled it and rainloop works perfectly.
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 Rainloop-1.6.3.706-e3c14e17bc4370a1561bcc68d1d494fd.zip - small R and same on the next line.
Checked the 'chown' command. Both 'chown -R username filename' and 'chown username filename -R' are valid commands, working perfectly in my Ubuntu box.
Yes, the name of the zipped file has a typo. I'll request the mods to correct it. Thanks.
The typo was fixed. Thanks.
I tried to install it but gived this error. http://domain/webmail/?admin:
[302] The following PHP extensions are not available in your PHP configuration!
cURL
Looks like curl is not installed. Please try again after installing php5-curl.
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/1.6.7.126/app/libraries/RainLoop/Providers/ChangePassword.php on line 54, referer: http://www.XXXXXX.com/webmail/
I'm not well versed in PHP, and would appreciate any help that you can offer.
Not sure what seems to be the problem. I'm not well versed in PHP as well :). Could you please confirm that you have used username@domain.com while loggin in?
Yes I tried to log in as username@domain.com. and have double verified that my username and password are correct. If I try an invalid username or p/w I get a message saying "authentication failed".
Fixed it.
/var/www/webmail/rainloop/v/1.6.7.126/app/libraries/RainLoop/Providers/ChangePassword.php 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.
need to enable the option to change password for my email accounts but I could not install the poppassd and nothing
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?
apache is the user