User Tools

Site Tools


computing:roundcube

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
computing:roundcube [2026/04/08 14:45] – oemb1905computing:roundcube [2026/11/07 17:28] (current) – oemb1905
Line 156: Line 156:
 </code> </code>
  
 +After update, you might need to update db tables or what not. Check the forums. Here's a 1.6 to 1.7 change and the script that roundcube provided to update the db:
  
- --- //[[alerts@haacksnetworking.org|oemb1905]] 2026/04/05 04:31//+  cd /var/www/roundcube 
 +  sudo -u www-data ./bin/updatedb.sh --package=roundcube --dir=SQL
  
 +To setup a fail2ban filter that works with this setup, use something like the following:
 +
 +<code>
 +nano /etc/fail2ban/filter.d/roundcube-haack.conf
 +[Definition]
 +failregex = ^\[\S+\s+\S+\s+\S+\]: <\S+> IMAP Error: Login failed for .* from <HOST>\..*$
 +ignoreregex =
 +</code>
 +
 +Inside jail.local or an appropriate sub-directory, enter something like:
 +<code>
 +[roundcube-haack]
 +enabled  = true
 +filter   = roundcube-haack
 +logpath  = /var/www/roundcube/logs/errors.log
 +port     = http,https
 +maxretry = 2
 +datepattern = ^\[DayMONExYear 24hour:Minute:Second
 +</code>
 +
 +This command can help during testing the jail:
 +
 +  fail2ban-client reload --restart --unban roundcube-haack
 +
 +Make sure the log directories and files exist and have proper perms:
 +
 +  mkdir -p /var/www/roundcube/logs
 +  touch /var/www/roundcube/logs/errors.log
 +  chown www-data:www-data /var/www/roundcube/logs/errors.log
 +
 +For nginx, you can use these:
 +
 +<code>
 +server {
 +    listen 80;
 +    listen [::]:80;
 +    server_name mail.domain.com;
 +    return 301 https://$host$request_uri;
 +}
 +
 +server {
 +    listen 443 ssl http2;
 +    listen [::]:443 ssl http2;
 +    server_name mail.domain.com;
 +
 +    root /var/www/roundcube/public_html;
 +    index index.php;
 +
 +    ssl_certificate     /etc/letsencrypt/live/mail.domain.com/fullchain.pem;
 +    ssl_certificate_key /etc/letsencrypt/live/mail.domain.com/privkey.pem;
 +
 +    access_log /var/log/nginx/roundcube_access.log;
 +    error_log  /var/log/nginx/roundcube_error.log;
 +
 +    location / {
 +        try_files $uri $uri/ /index.php?$query_string;
 +    }
 +
 +    # Required for 1.7+ static assets (skins, plugins, program)
 +    location ~ ^/(assets|skins|plugins|program)/ {
 +        try_files $uri /static.php?$args;
 +    }
 +
 +    location ~ \.php(?:$|/) {
 +        fastcgi_split_path_info ^(.+\.php)(/.+)$;
 +        include snippets/fastcgi-php.conf;
 +        fastcgi_pass unix:/run/php/php8.4-fpm.sock;
 +        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
 +        fastcgi_param PATH_INFO $fastcgi_path_info;
 +        include fastcgi_params;
 +    }
 +
 +    # Lock down installer after setup - UNLOCK / COMMENT OUT when fixing
 +    #location ~ ^/(installer|SQL)/ {
 +    #    deny all;
 +    #}
 +
 +    location ~ /\.ht {
 +        deny all;
 +    }
 +}
 +</code>
 +
 +And for fail2ban:
 +
 +<code>
 +nano /etc/fail2ban/filter.d/roundcube-haack.conf
 +[Definition]
 +failregex = ^<HOST> .* "POST /.*\?_task=login HTTP.*" 401
 +            ^<HOST> .* "POST /index\.php\?_task=login HTTP.*" 401
 +            ^<HOST> .* "POST /.* HTTP.*" 401
 +ignoreregex =
 +</code>
 +
 +<code>
 +nano /etc/fail2ban/jail.local
 +[roundcube-haack]
 +enabled  = true
 +port     = http,https
 +filter   = roundcube-haack
 +logpath  = /var/log/nginx/roundcube_access.log
 +maxretry = 2
 +</code>
 +
 + --- //[[alerts@haacksnetworking.org|oemb1905]] 2026/11/07 17:19//
computing/roundcube.1775659551.txt.gz · Last modified: by oemb1905