Update to MailScanner-5.4.2-3 - htmlpurifier

Bugs in eFa 4
Post Reply
henk
Posts: 517
Joined: 14 Dec 2015 22:16
Location: Netherlands
Contact:

Update to MailScanner-5.4.2-3 - htmlpurifier

Post by henk »

After an update this morning to MailScanner-5.4.2-3

I noticed 2 errors in

Code: Select all

/var/log/php-fpm/www-error.log
1.
[01-Dec-2021 12:10:21 Europe/Amsterdam] PHP Notice: Undefined variable: dir in /var/www/html/mailscanner/msmail.inc.php on line 33

After a reboot this one is gone. ( due the restart of Mailscanner?)

2.
[01-Dec-2021 12:17:07 Europe/Amsterdam] PHP Warning: Directory /var/www/html/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer not writable, please chmod to 777 in /var/www/html/mailscanner/lib/htmlpurifier/HTMLPurifier.standalone.php on line 15816


For the second one I had a look at http://htmlpurifier.org/download

Code: Select all

Installation
File permissions

HTML Purifier will write out cache files for HTMLDefinition in the subdirectories of HTMLPurifier/DefinitionCache/Serializer. If you are in the library/ folder of HTML Purifier, you can set the appropriate permissions using:

chmod -R 0755 HTMLPurifier/DefinitionCache/Serializer

If the above command doesn't work, you may need to assign write permissions to all. This may be necessary if your webserver runs as nobody, but is not recommended since it means any other user can write files in the directory. Use:

chmod -R 0777 HTMLPurifier/DefinitionCache/Serializer
To get rid of the error I executed:

Code: Select all

chmod -R 0777 /var/www/html/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer

Code: Select all

ls -la /var/www/html/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer

Code: Select all

total 0
drwxrwxrwx. 3 root    root    36 Dec  1 14:02 .
drwxr-xr-x. 3 root    root    24 Nov 22 03:14 ..
drwxr-xr-x  2 php-fpm php-fpm 67 Dec  1 14:02 HTML
-rwxrwxrwx  1 root    root     0 Nov 22 03:14 index.html

Shawn can you comment on this solution?
“We are stuck with technology when what we really want is just stuff that works.” -Douglas Adams
User avatar
shawniverson
Posts: 3640
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Update to MailScanner-5.4.2-3 - htmlpurifier

Post by shawniverson »

Probably just needs the user/group php-fpm, I'm guessing, instead of 0777. I'll test it out.
VAXman65
Posts: 20
Joined: 23 Feb 2020 20:01

Re: Update to MailScanner-5.4.2-3 - htmlpurifier

Post by VAXman65 »

I am getting the same error from time to time (journal[1237]: ool www[1237]: PHP Notice: Undefined variable: dir in /var/www/html/mailscanner/msmail.inc.php on line 33). I have nothing pending in sealert. I have manually adjusted the file ownerships and protection masks as reported below and rebooted since then (incase a reboot would clear the issue).

Code: Select all

[root@ballantine ~]# ls -al /var/www/html/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/DefinitionCache
total 0
drwxr-xr-x. 3 root root  24 Jul 14 16:10 .
drwxr-xr-x. 9 root root 146 Jul 14 16:10 ..
drwxrwxrwx. 3 root root  36 Jul 14 23:49 Serializer
[root@ballantine ~]# ls -al /var/www/html/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer
total 0
drwxrwxrwx. 3 root   root   36 Jul 14 23:49 .
drwxr-xr-x. 3 root   root   24 Jul 14 16:10 ..
drwxr-xr-x. 2 apache apache 67 Jul 14 23:49 HTML
-rw-r--r--. 1 root   root    0 Nov 21  2021 index.html
[root@ballantine ~]# ls -al ls -al /var/www/html/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer/HTML/
ls: cannot access 'ls': No such file or directory
/var/www/html/mailscanner/lib/htmlpurifier/standalone/HTMLPurifier/DefinitionCache/Serializer/HTML/:
total 92
drwxr-xr-x. 2 apache apache    67 Jul 14 23:49 .
drwxrwxrwx. 3 root   root      36 Jul 14 23:49 ..
-rw-r--r--. 1 apache apache 93685 Jul 14 23:49 4.13.0,f474c0a322b208e83d22d3aef33ecb184bc71d31,1.ser
Ideas anyone?
Post Reply