-
Bug
-
Resolution: Unresolved
-
Major
-
None
-
3.3.0
-
None
-
Debian 10, PHP 7.3.14, MariaDB 10.3.22, Exim 4.92, Chromium 81.0.4044.138
Problem: I enabled email notification about private messages and sent a test PM. Then I started getting the same notification email in my server syslog every 5 minutes, but I wanted only one email.
Investigation: I have full Debian server with phpBB 3.3. I have user webmaster for the CLI access and my web-server run as www-data user, both users are in group www-data. Every 5 minutes crond runs bin/phpbbcli.php as user webmaster. Syslog shows that crond is trying to send extra emails using mail() in includes/functions_messenger.php:1929. Futher investigation shows that phpBB email queue is stored in the cache-file cache/production/queue.php. This cache-file was created by web-server (user www-data) and is processing by crond (user webmaster). After every processing phpBB tries to unlink this cache-file unsuccessfully because of permission problem. It is possible for user webmaster to write anything to this cache-file (for instance empty queue) but it is impossible to unlink this file because of parent dir permission: drwxr-xr-x 3 www-data www-data. So my personal solution is changing cache/production/ permissions to drwxrwxr-x.
Proposed solutions:
1) Change initial cache/production/ permissions to drwxrwxrwx.
2) Replace unlink() by writing empty queue.
3) Еnforce customers to use the same user for web-server and external crond (bad idea in my mind).