hestiacp / hestiacp

Hestia Control Panel | A lightweight and powerful control panel for the modern web.
https://hestiacp.com
GNU General Public License v3.0
3.4k stars 680 forks source link

[Bug] Snappymail fails with data folder permission error #4099

Closed imyller closed 7 months ago

imyller commented 1 year ago

Describe the bug

After HestiaCP 1.8.10 upgrade Snappymail fails to load with error:

[202] Data folder permissions error [is_readable]

Owner of both /var/lib/snappymail/data (symlink) and /etc/snappymail/data is www-data:www-data

v-add-sys-snappymail reports that the installation is latest and ok:

# v-add-sys-snappymail 
Error: Installed version (2.29.1) is equal to the available version (2.29.1)

Could this be caused by new security hardening from secure_php.sh?

Tell us how to replicate the bug

  1. Upgrade to HestiaCP 1.8.10
  2. Open webmail.domain.tld where Snappymail is selected as webmail client
  3. Receive error '[202] Data folder permissions error [is_readable]' with HTTP/200 status

Which components are affected by this bug?

Webmail (Roundcube, SnappyMail)

Hestia Control Panel Version

1.8.10

Operating system

Ubuntu 22.04

Log capture

No response

sahsanu commented 1 year ago

To check whether disabled php functions are affecting snappymail, modify /etc/php/PHP_VERSION/fpm/php.ini

Example for PHP version 8.2:

sed -i 's/^disable_functions =.*/disable_functions = /' /etc/php/8.2/fpm/php.ini

jaapmarcus commented 1 year ago

To check whether disabled php functions are affecting snappymail, modify /etc/php/PHP_VERSION/fpm/php.ini

Example for PHP version 8.2:

sed -i 's/^disable_functions =.*/disable_functions = /' /etc/php/8.2/fpm/php.ini

We changed the owner to hestiamail instead of www-data due to the security issue

jaapmarcus commented 1 year ago

chown -R hestiamail:www-data /etc/snappymail/data should probally solve..

plutocrat commented 1 year ago

Seems also rainloop affected.

rjc3rd commented 1 year ago

Just leaving this here to get the update/notifications, how to solve? For now, I don't have clients on my server, so I plan to wait it out.

jaapmarcus commented 1 year ago

chown -R hestiamail:www-data /etc/snappymail/data

Will solve the issue .... Probally will test tomorrow...

rjc3rd commented 1 year ago

First, I confirmed that Roundcube worked while Snappymail did not work.

Roundcube worked. Snappymail did not work.

chown -R hestiamail:www-data /etc/snappymail/data Will solve the issue .... Probally will test tomorrow...

This did indeed fix the problem with Snappymail.

imyller commented 1 year ago

chown -R hestiamail:www-data /etc/snappymail/data

Fixing the owner solved the issue for Snappymail.

Owner of the data folder was www-data by default.

plutocrat commented 1 year ago

Snappymail installer script also needs to be adjusted. v-add-sys-snappymail