Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty ticket description when character encoding is not UTF-8 #15389

Closed
2 tasks
Tbence95 opened this issue Aug 10, 2023 · 6 comments
Closed
2 tasks

Empty ticket description when character encoding is not UTF-8 #15389

Tbence95 opened this issue Aug 10, 2023 · 6 comments

Comments

@Tbence95
Copy link

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.9

Bug description

If mail encoding is UTF8, GLPI creates a blank ticket. The subject is ok, but the description is empty

Relevant log output

No response

Page URL

No response

Steps To reproduce

Send an email from CentOS7 to GLPI.
mail version: 12.5 7/5/10

Your GLPI setup information

Operating system: Linux glpi.example.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
PHP 7.4.33 apache2handler (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, apcu, bz2, calendar,
ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, imap, intl, json, ldap, libxml, mbstring, mysqli,
mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, session, soap, sockets, sodium, sqlite3, standard, tokenizer, xml, xmlreader,
xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="50" memory_limit="128M" post_max_size="100M" safe_mode="" session.save_handler="files"
upload_max_filesize="100M"
Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33 mod_perl/2.0.11 Perl/v5.16.3 ()
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.188
Server Software: MariaDB Server
Server Version: 10.5.21-MariaDB
Server SQL Mode: STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
Parameters: gpli@127.0.0.1/gpli
Host info: 127.0.0.1 via TCP/IP

Anything else?

We have modified the src/MailCollectro.php file, and now it works in some cases. In other Cases not, but i don't know why.

1821
1822 if (strlen($content) < 2 ) { $content = utf8_encode($part); }
1823 // $cron_msg1=print_r($content, true);
1824 $timestemp_message=date("Y/m/d H:i:s");
1825 $cron_msg1="
1826
1827 $timestemp_message " . "
1828 original: " . utf8_encode($part) . "
1829 modified: " . $content . "
1830 ";
1831
1832 $myfile = fopen("/srv/www/glpi/files/_log/mailgate_cron.log", "a") or die("Unable to open file!");
1833 fwrite($myfile, $cron_msg1);
1834 fclose($myfile);
1835
1836 // ** URES MAIL VEGE **
1837
1838 return $content;
1839 }

@cedric-anne
Copy link
Member

Hi,

Please attach the source of the email into an .eml file.

@Tbence95
Copy link
Author

Can't upload eml, i paste here the content of eml file

Return-path: server@example.com
Received: from mail2.example.com ([x.x.x.x])
by mail.example.com with ESMTP (NOT encrypted); Thu, 10 Aug 2023 09:26:49 +0200
Received: from server.example.com (server.example.com [x.x.x.x])
by mail2.example.com (Postfix) with ESMTP id 8253AC080B
for helpdesk@example.com; Thu, 10 Aug 2023 09:26:49 +0200 (CEST)
Received: by server.example.com (Postfix, from userid 0)
id 7656452002F; Thu, 10 Aug 2023 09:26:49 +0200 (CEST)
Date: Thu, 10 Aug 2023 09:26:49 +0200
To: helpdesk@example.com
Subject: test mail
User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-Id: 20230810072649.7656452002F@server.example.com
From: server@example.com (root)

GLPI blank email test

@trasher
Copy link
Contributor

trasher commented Aug 10, 2023

Rename to txt or zip it. We need EML file, not its content.

@Tbence95
Copy link
Author

test mail.zip

@cedric-anne
Copy link
Member

I am not able to reproduce the issue:

image

@trasher
Copy link
Contributor

trasher commented Sep 26, 2023

No feedback from a while, closing.

@trasher trasher closed this as completed Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants