[How-to] RainLoop in Hestia CP

Obsolete - Please check out rufle’s post & How to install Rainloop docs.

So you would like to grasp your hands on RainLoop for fun or maybe you don’t like Roundcube at all (like me)?

Either way, here is the tuto how to get RainLoop to work on Hestia CP.

Prerequisities:

  • Installed nginx, php, properly configured SSL (+HSTS)

Steps:

  1. Navigate to /usr/local/hestia/data/templates/mail/nginx/
  2. Alter web_system.tpl & web_system.stpl as shown below
  3. Create a new config for socket in /etc/php/7.4/fpm/pool.d/mail.domain.conf
  4. Install RainLoop to the folder specified in templates
  5. Reload nginx & php

Notes:

  • Alter templates according to your needs
  • I do advise to alter them according to your backend config

web_system.tpl (nginx):

server {
listen %ip%:%web_port%;
server_name %domain% %alias%;
more_clear_headers “Strict-Transport-Security”;

location ^~ /.well-known/acme-challenge/ {
    root /var/lib/roundcube/;
    default_type "text/plain";  
}

location / {
    return 301 https://%domain%$request_uri;
}

include %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*;

}

web_system.stpl (nginx):

server {
listen %ip%:%web_ssl_port% ssl http2;
server_name %domain% %alias%;
root %home%/%user%/web/%domain%/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/%domain%.log combined;
error_log /var/log/nginx/domains/%domain%.error.log error;

ssl_certificate     %ssl_pem%;
ssl_certificate_key %ssl_key%;

location ^~ /.well-known/acme-challenge/ {
    root /var/lib/roundcube/;
    default_type "text/plain";  
}

location ^~ /data {
    deny all;
    return 404;
}

location / {
    location ~ [^/]\.php(/|$) {
        fastcgi_split_path_info ^(.+?\.php)(/.*)$;
        if (!-f $document_root$fastcgi_script_name) {
            return  404;
        }

        alias %home%/%user%/web/%domain%/public_html/$1;
        fastcgi_param HTTP_PROXY "";
        fastcgi_pass unix:/run/php/php7.4-fpm-%domain%.sock;
        fastcgi_index index.php;
        include /etc/nginx/fastcgi_params;
    }

    location ~* ^.+\.(ogg|ogv|svg|svgz|swf|eot|otf|woff|woff2|mov|mp3|mp4|webm|flv|ttf|rss|atom|jpg|jpeg|gif|png|ico|bmp|mid|midi|wav|rtf|css|js|jar)$ {
        expires max;
        fastcgi_hide_header "Set-Cookie";
    }
}

location /error/ {
    alias   %home%/%user%/web/%domain%/document_errors/;
}

include %home%/%user%/conf/mail/%root_domain%/%web_system%.conf_*;

}

mail.domain.conf (php):

  1. Duplicate already existing domain config
  2. Rename config accordingly
  3. Make manual changes - find & replace

Reload nginx:

  • nginx -s reload

Reload php:

  • systemctl reload php7.4-fpm

Do not hesitate to ping me in case of troubles.

  • RainLoop
  • Roundcube
0 voters
6 Likes

This instruction is no longer relevant (reinloop is no longer supported in Hestiacp). You need to install snappymail instead:

  1. Install snappymail via the following command
    bash /usr/local/hestia/bin/v-add-sys-snappymail
  2. Go to Edit Mail Domain
  3. Select snappymail as a Webmail Client

1 Like

See:

https://docs.hestiacp.com/admin_docs/mail.html#how-to-install-rainloop

@ruflex @eris Thanks, updated the tutorial.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.