You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2016-08-29 12:37:14

auto1
Member
Registered: 2016-08-29
Posts: 5

Error catching emails with emoticons

Hi all,

I'm using GLPI 0.90.5 on a Windows Server 2012 R2 (IIS) with PHP 5.6 and Google mail.

I now found out that I have several errors when collecting mails. All mails have one thing in common - they contain emoticons.

Is there anything like a switch/flag that I can set to maximize compatibility?

If not - please fix this bug.

Thank you very much!

Offline

#2 2016-08-29 14:17:47

auto1
Member
Registered: 2016-08-29
Posts: 5

Re: Error catching emails with emoticons

Update:
It seems like an incompatible character set conversion in the sql-backend. I first was wondering where to find a detailed mail error log, but meanwhile I stumbled over the following error in the sql-errors.log:

  Error: Incorrect string value: '\xF0\x9F\x8F\xBB\x0A\x0A...' for column 'content' at row 1
  Backtrace :
  inc\commondbtm.class.php:428                       
  inc\commondbtm.class.php:834                       CommonDBTM->addToDB()
  inc\mailcollector.class.php:555                    CommonDBTM->add()
  front\mailcollector.form.php:80                    MailCollector->collect()

so catching mail seems to work, but inserting into DB (mySQL) fails.

Any idea?

Offline

#3 2016-09-02 16:06:53

yllen
GLPI-DEV
From: Sillery (51)
Registered: 2008-01-14
Posts: 15,278

Re: Error catching emails with emoticons

Can you give me the body of the mail (with the complete text xF0\x9F\x8F\xBB\x0A\x0A..)?


CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6  - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)

Offline

#4 2016-09-05 12:46:14

auto1
Member
Registered: 2016-08-29
Posts: 5

Re: Error catching emails with emoticons

Hi Yllen,

that's the body-part of the email (plain-text):

--001a113db620acd5d2053bc04df1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

This is a test-mail with a smiley =F0=9F=98=82
Shouldn't work with GLPI or at least fails to be inserted into mysql.

--001a113db620acd5d2053bc04df1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">This is a test-mail with a smiley=C2=A0=F0=9F=98=82<br><di=
v><div class=3D"gmail_signature"><div dir=3D"ltr"><div><div dir=3D"ltr"><di=
v><div dir=3D"ltr"><div><div dir=3D"ltr"><div><div dir=3D"ltr"></div></div>=
</div></div></div></div></div></div></div></div></div>
<div>Shouldn&#39;t work with GLPI or at least fails to be inserted into mys=
ql.</div></div>

--001a113db620acd5d2053bc04df1--

Hope you'll find something that helps catching those mails to - because you'll never get the users to stop using smileys ;-)

Many thanks.

Offline

#5 2016-09-05 12:49:29

auto1
Member
Registered: 2016-08-29
Posts: 5

Re: Error catching emails with emoticons

... and here comes the according sql-error.log entry:

  Error: Incorrect string value: '\xF0\x9F\x98\x82\x0A\x0A...' for column 'content' at row 1
  Backtrace :
  inc\commondbtm.class.php:428                       
  inc\commondbtm.class.php:834                       CommonDBTM->addToDB()
  inc\mailcollector.class.php:565                    CommonDBTM->add()
  inc\mailcollector.class.php:1601                   MailCollector->collect()
  :                                                  MailCollector::cronMailgate()
  inc\crontask.class.php:799                         call_user_func()
  front\cron.php:66                                  CronTask::launch()

... couldn't paste the complete INSERT as PunBB (Forum-Software) cuts such characters. --> Probably something similar as with the GLPI SQL-INSERT?

Last edited by auto1 (2016-09-05 13:00:24)

Offline

#6 2016-09-05 18:34:24

noximuz
Member
Registered: 2016-03-09
Posts: 21

Re: Error catching emails with emoticons

Most likely you have incorrect encoding for connection / database, you should change it to UTF-8.


Glpi 9.2.2

Offline

#7 2016-09-12 16:47:32

auto1
Member
Registered: 2016-08-29
Posts: 5

Re: Error catching emails with emoticons

Thanks for your hint.

In mySQL the collation is set to utf8_unicode_ci (for DB and all tables).
In php.ini the default_charset is set to UTF-8
In GLPI config-folder I couldn't see anything like utf or char(set) to change.

With this setup I get the error "Error: Incorrect string value: '\xF0\x9F\x8F\xBB\x0A\x0A...' for column 'content' at row 1" while inserting into glpi_tickets.

Any idea where else I could check for the encoding settings?

Many thanks

Offline

Board footer

Powered by FluxBB