glpi-project/glpi

Images pasted into the body of an email do not appear in tickets.

Molina15 opened this issue · 20 comments

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Version

10.0.1

Bug description

When a new ticket is created from an email, if it has images (I don't mean attached files, those don't cause problems), they are not displayed. I have seen that with previous versions #1929 there was also this problem and it ended up being corrected, but with version 10.0.1 it happens again, at least for me.

image

Relevant log output

No response

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

Operating system: Linux ubuntu-glpi 5.4.0-120-generic #136-Ubuntu SMP Fri Jun 10 13:40:48 UTC 2022 x86_64
PHP 7.4.3 apache2handler (Core, FFI, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, apc, apcu, bz2,
calendar, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, intl, json, ldap, libxml, mbstring,
mysqli, mysqlnd, openssl, pcre, pdo_mysql, posix, readline, session, shmop, sockets, sodium, standard, sysvmsg, sysvsem,
sysvshm, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="30" memory_limit="128M" post_max_size="8M" safe_mode="" session.save_handler="files"
upload_max_filesize="2M"
Software: Apache/2.4.41 (Ubuntu) (Apache/2.4.41 (Ubuntu) Server at 192.168.100.42 Port 80
)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Server Software: Ubuntu 20.04
Server Version: 10.3.34-MariaDB-0ubuntu0.20.04.1
Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Parameters: glpi@localhost/glpi
Host info: Localhost via UNIX socket

PHP version (7.4.3) is supported.PHP version (7.4.3) is supported.
Sessions configuration is OK.Sessions configuration is OK.
Allocated memory is sufficient.Allocated memory is sufficient.
mysqli extension is installed.mysqli extension is installed.
Following extensions are installed: dom, fileinfo, json, simplexml.Following extensions are installed: dom, fileinfo, json, simplexml.
curl extension is installed.curl extension is installed.
gd extension is installed.gd extension is installed.
intl extension is installed.intl extension is installed.
libxml extension is installed.libxml extension is installed.
zlib extension is installed.zlib extension is installed.
The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.
Database engine version (10.3.34) is supported.Database engine version (10.3.34) is supported.
The log file has been created successfully.The log file has been created successfully.
Write access to /var/www/glpi/files/_cache has been validated. Write access to /var/www/glpi/config has been validated. Write access to /var/www/glpi/files/_cron has been validated. Write access to /var/www/glpi/files has been validated. Write access to /var/www/glpi/files/_dumps has been validated. Write access to /var/www/glpi/files/_graphs has been validated. Write access to /var/www/glpi/files/_lock has been validated. Write access to /var/www/glpi/files/_pictures has been validated. Write access to /var/www/glpi/files/_plugins has been validated. Write access to /var/www/glpi/files/_rss has been validated. Write access to /var/www/glpi/files/_sessions has been validated. Write access to /var/www/glpi/files/_tmp has been validated. Write access to /var/www/glpi/files/_uploads has been validated.Write access to /var/www/glpi/files/_cache has been validated.
Write access to /var/www/glpi/config has been validated.
Write access to /var/www/glpi/files/_cron has been validated.
Write access to /var/www/glpi/files has been validated.
Write access to /var/www/glpi/files/_dumps has been validated.
Write access to /var/www/glpi/files/_graphs has been validated.
Write access to /var/www/glpi/files/_lock has been validated.
Write access to /var/www/glpi/files/_pictures has been validated.
Write access to /var/www/glpi/files/_plugins has been validated.
Write access to /var/www/glpi/files/_rss has been validated.
Write access to /var/www/glpi/files/_sessions has been validated.
Write access to /var/www/glpi/files/_tmp has been validated.
Write access to /var/www/glpi/files/_uploads has been validated.
Web access to files directory is protectedWeb access to files directory is protected
exif extension is installed.exif extension is installed.
ldap extension is installed.ldap extension is installed.
openssl extension is installed.openssl extension is installed.
zip extension is installed.zip extension is installed.
bz2 extension is installed.bz2 extension is installed.
Zend OPcache extension is installed.Zend OPcache extension is installed.
Following extensions are installed: ctype, iconv, mbstring, sodium.Following extensions are installed: ctype, iconv, mbstring, sodium.
Write access to /var/www/glpi/marketplace has been validated.Write access to /var/www/glpi/marketplace has been validated.
Timezones seems loaded in database.Timezones seems loaded in database.

Anything else?

No response

Hi,

Could you please export the email that cause the issue into eml format and attach it here ? It would help us to reproduce the issue.

Hello,

It happens with all mail with image. Attached is the one I used for the sample image published here.

image test.zip

Probably is related with this? #11933

I tried the attached email after applying this 9333ae1 and it seems ok

@Molina15 please test with patch pointed by @dxdemetriou

Hello, sorry for the delay in responding. The mail server is giving us problems and I can't do the test. The case is that I updated to version 10.0.2 where the correction that you propose is already applied and even so, it doesn't work.
I have noticed when creating a ticket from Helpdesk, that when copying/pasting an image it does not appear either and only the icon is seen. Maybe it's causing the same error...

image

image

I cannot reproduce the issue using provided eml file.

image

I tried on both PHP 8.1.x and 7.4.30.

You are using PHP 7.4.3, you should try to update to 7.4.30, maybe this is related to a PHP bug.

Hi, I have updated my version of PHP to 8.1 and restarted the service.

image

Now, the images I paste in the glpi itself if they work (1 problem solved), but the pastes on the body of the mails, still do not appear :(

image

Hello, sorry for the delay in responding. The mail server is giving us problems and I can't do the test. The case is that I updated to version 10.0.2 where the correction that you propose is already applied and even so, it doesn't work. I have noticed when creating a ticket from Helpdesk, that when copying/pasting an image it does not appear either and only the icon is seen. Maybe it's causing the same error...

image

image

Probably it's because images are in http instead of https, or by the use of the IP and any required authentication. Anything in http cannot be loaded in https, and anything used in local network (probably as link like drag-and-drop in some software?) then maybe are not accessible by GLPI.

@Molina15 in General, the "URL of the application" is in http and you are using https?

I use http to access.

image

the pastes on the body of the mails, still do not appear :(

image

What are these images URL ?

denied:cid:c2a9038c9d90edfc8c738a7d8f2eca79f5789481@zimbra

denied:cid:1bd3700ace4fc89b9bb1918ec2cd6c48837590f3@zimbra

image

This is what appears when I try to open the images separately and also when looking at html code of the page.

Can you provide, into eml format, the email that cause this issue ?
Also, do you have any active plugin ? In this case, please try to reproduce with no active plugin.

Sorry, the error is not caused by any plugin, it's a google chrome thing (I don't know the cause), with edge it works fine.

@Molina15

When a new ticket is created from an email,

Is this a copy/paste in the browser, or a ticket created from mail collector ?

Could you check in browser console if you have an error when you paste an image, when this issue happens ?

Hi,

In both chrome and edge, when I do Copy/paste and hit add, I get a box with the error "Problem moving file" (something that had been solved when upgrading to php 8.1, but now it gives an error again). Instead I use the insert image function that embeds the text box, the images load correctly.

image

image

On the other hand, if the ticket is captured through mailcollector, in edge I can see them but not in chrome.

image EDGE

image CHROME

EDIT: The issue of pasting images may be due to a problem with the clipboard. When I do "screen capture" and paste the image, it doesn't load, but instead if I copy an image with right click "copy" and then control "V", then it works.

In edge, if I open the URL of the image itself, it is displayed, in chrome, it is not.

image

image

Do you need anything else?

EDIT: The issue of pasting images may be due to a problem with the clipboard. When I do "screen capture" and paste the image, it doesn't load, but instead if I copy an image with right click "copy" and then control "V", then it works.

As I do not have access to a Windows environment, I cannot try to reproduce. Maybe someone else could help.

There has been no activity on this issue for some time and therefore it is considered stale and will be closed automatically in 10 days.

If this issue is related to a bug, please try to reproduce on latest release. If the problem persist, feel free to add a comment to revive this issue.
If it is related to a new feature, please open a topic to discuss with community about this enhancement on suggestion website.

You may also consider taking a subscription to get professionnal support or contact GLPI editor team directly.

Removed non english comments