glpi-project / glpi

GLPI is a Free Asset and IT Management Software package, Data center management, ITIL Service Desk, licenses tracking and software auditing.
https://glpi-project.org
GNU General Public License v3.0
4.14k stars 1.28k forks source link

PHP error : Uncaught Exception Laminas\Mail\Storage\Exception\InvalidArgumentException at line 64 #11706

Closed adamcios closed 2 years ago

adamcios commented 2 years ago

Code of Conduct

Is there an existing issue for this?

Version

9.5.7

Bug description

i dont know why i got this error message. It is no longer possible to retrieve messages.

Relevant log output

[2022-05-27 13:41:12] glpiphplog.CRITICAL:   *** Uncaught Exception Laminas\Mail\Header\Exception\InvalidArgumentException: Invalid header value detected in C:\xampp\htdocs\glpi\vendor\laminas\laminas-mail\src\Header\GenericHeader.php at line 64
  Backtrace :
  vendor\laminas\laminas-mail\src\Headers.php:544    Laminas\Mail\Header\GenericHeader::splitHeaderLine()
  vendor\laminas\laminas-mail\src\Headers.php:284    Laminas\Mail\Headers->loadHeader()
  vendor\laminas\laminas-mail\src\Headers.php:105    Laminas\Mail\Headers->addHeaderLine()
  vendor\laminas\laminas-mime\src\Decode.php:150     Laminas\Mail\Headers::fromString()
  ...r\laminas\laminas-mail\src\Storage\Part.php:111 Laminas\Mime\Decode::splitMessage()
  ...laminas\laminas-mail\src\Storage\Message.php:53 Laminas\Mail\Storage\Part->__construct()
  ...r\laminas\laminas-mail\src\Storage\Imap.php:127 Laminas\Mail\Storage\Message->__construct()
  ...aminas-mail\src\Storage\AbstractStorage.php:268 Laminas\Mail\Storage\Imap->getMessage()
  inc\mailcollector.class.php:721                    Laminas\Mail\Storage\AbstractStorage->current()
  inc\mailcollector.class.php:1762                   MailCollector->collect()
  inc\crontask.class.php:943                         MailCollector::cronMailgate()
  front\cron.php:83                                  CronTask::launch()

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

GLPI 9.5.7 ( => C:\xampp\htdocs\glpi) Installation mode: TARBALL Current language:pl_PL

Operating system: Windows NT IT-05 10.0 build 19044 (Windows 10) AMD64 PHP 7.4.24 apache2handler (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, bcmath, bz2, calendar, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, intl, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcre, pdo_mysql, pdo_sqlite, readline, session, soap, sodium, standard, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, zip, zlib) Setup: max_execution_time="120" memory_limit="768M" post_max_size="40M" safe_mode="" session.save_handler="files" upload_max_filesize="400M" Software: Apache/2.4.51 (Win64) OpenSSL/1.1.1l PHP/7.4.24 (Apache/2.4.51 (Win64) OpenSSL/1.1.1l PHP/7.4.24 Server at pomoc.o-it.pl Port 443) Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36 Server Software: mariadb.org binary distribution Server Version: 10.4.21-MariaDB Server SQL Mode: Parameters: glpi@localhost/glpi Host info: localhost via TCP/IP PHP version is at least 7.2.0 - Perfect! Sessions support is available - Perfect! Allocated memory > 64 Mio - Perfect! mysqli extension is installed ctype extension is installed fileinfo extension is installed json extension is installed mbstring extension is installed iconv extension is installed zlib extension is installed curl extension is installed gd extension is installed simplexml extension is installed intl extension is installed ldap extension is not present apcu extension is not present Zend OPcache extension is installed xmlrpc extension is installed exif extension is installed zip extension is installed bz2 extension is installed sodium extension is installed Database version seems correct (10.4.21) - Perfect! Timezones seems loaded in database The log file has been created successfully. Write access to C:\xampp\htdocs\glpi/files/_cache has been validated. Write access to C:\xampp\htdocs\glpi/config has been validated. Write access to C:\xampp\htdocs\glpi/files/_cron has been validated. Write access to C:\xampp\htdocs\glpi/files has been validated. Write access to C:\xampp\htdocs\glpi/files/_dumps has been validated. Write access to C:\xampp\htdocs\glpi/files/_graphs has been validated. Write access to C:\xampp\htdocs\glpi/files/_lock has been validated. Write access to C:\xampp\htdocs\glpi/files/_pictures has been validated. Write access to C:\xampp\htdocs\glpi/files/_plugins has been validated. Write access to C:\xampp\htdocs\glpi/files/_rss has been validated. Write access to C:\xampp\htdocs\glpi/files/_sessions has been validated. Write access to C:\xampp\htdocs\glpi/files/_tmp has been validated. Write access to C:\xampp\htdocs\glpi/files/_uploads has been validated. Write access to C:\xampp\htdocs\glpi/marketplace has been validated. Web access to the files directory should not be allowed but this cannot be checked automatically on this instance. Make sure access to error log file (/files/_log/php-errors.log) is forbidden; otherwise review .htaccess file and web server configuration.

GLPI_ROOT: C:\xampp\htdocs\glpi GLPI_CONFIG_DIR: C:\xampp\htdocs\glpi/config GLPI_VAR_DIR: C:\xampp\htdocs\glpi/files GLPI_MARKETPLACE_DIR: C:\xampp\htdocs\glpi/marketplace GLPI_USE_CSRF_CHECK: 1 GLPI_CSRF_EXPIRES: 7200 GLPI_CSRF_MAX_TOKENS: 100 GLPI_USE_IDOR_CHECK: 1 GLPI_IDOR_EXPIRES: 7200 GLPI_ALLOW_IFRAME_IN_RICH_TEXT: GLPI_TELEMETRY_URI: https://telemetry.glpi-project.org GLPI_INSTALL_MODE: TARBALL GLPI_NETWORK_MAIL: glpi@teclib.com GLPI_NETWORK_SERVICES: https://services.glpi-network.com GLPI_MARKETPLACE_PRERELEASES: GLPI_MARKETPLACE_ALLOW_OVERRIDE: 1 GLPI_MARKETPLACE_MANUAL_DOWNLOADS: 1 GLPI_USER_AGENT_EXTRA_COMMENTS: GLPI_AJAX_DASHBOARD: 1 GLPI_CALDAV_IMPORT_STATE: 0 GLPI_DEMO_MODE: 0 GLPI_FORCE_EMPTY_SQL_MODE: 1 GLPI_DOC_DIR: C:\xampp\htdocs\glpi/files GLPI_CACHE_DIR: C:\xampp\htdocs\glpi/files/_cache GLPI_CRON_DIR: C:\xampp\htdocs\glpi/files/_cron GLPI_DUMP_DIR: C:\xampp\htdocs\glpi/files/_dumps GLPI_GRAPH_DIR: C:\xampp\htdocs\glpi/files/_graphs GLPI_LOCAL_I18N_DIR: C:\xampp\htdocs\glpi/files/_locales GLPI_LOCK_DIR: C:\xampp\htdocs\glpi/files/_lock GLPI_LOG_DIR: C:\xampp\htdocs\glpi/files/_log GLPI_PICTURE_DIR: C:\xampp\htdocs\glpi/files/_pictures GLPI_PLUGIN_DOC_DIR: C:\xampp\htdocs\glpi/files/_plugins GLPI_RSS_DIR: C:\xampp\htdocs\glpi/files/_rss GLPI_SESSION_DIR: C:\xampp\htdocs\glpi/files/_sessions GLPI_TMP_DIR: C:\xampp\htdocs\glpi/files/_tmp GLPI_UPLOAD_DIR: C:\xampp\htdocs\glpi/files/_uploads GLPI_NETWORK_REGISTRATION_API_URL: https://services.glpi-network.com/api/registration/ GLPI_MARKETPLACE_PLUGINS_API_URI: https://services.glpi-network.com/api/glpi-plugins/ GLPI_I18N_DIR: C:\xampp\htdocs\glpi/locales GLPI_VERSION: 9.5.7 GLPI_SCHEMA_VERSION: 9.5.7 GLPI_MIN_PHP: 7.2.0 GLPI_YEAR: 2022 GLPI_MIN_VERSION: 9.5 GLPI_MAX_VERSION: 9.6

htmlawed/htmlawed version 1.2.5 in (C:\xampp\htdocs\glpi\vendor\htmlawed\htmlawed) phpmailer/phpmailer version 6.6.0 in (C:\xampp\htdocs\glpi\plugins\scimplementation\vendor\phpmailer\phpmailer\src) simplepie/simplepie version 1.5.6 in (C:\xampp\htdocs\glpi\vendor\simplepie\simplepie\library) tecnickcom/tcpdf version 6.3.5 in (C:\xampp\htdocs\glpi\vendor\tecnickcom\tcpdf) michelf/php-markdown in (C:\xampp\htdocs\glpi\vendor\michelf\php-markdown\Michelf) true/punycode in (C:\xampp\htdocs\glpi\vendor\true\punycode\src) iamcal/lib_autolink in (C:\xampp\htdocs\glpi\vendor\iamcal\lib_autolink) sabre/dav in (C:\xampp\htdocs\glpi\vendor\sabre\dav\lib\DAV) sabre/http in (C:\xampp\htdocs\glpi\vendor\sabre\http\lib) sabre/uri in (C:\xampp\htdocs\glpi\vendor\sabre\uri\lib) sabre/vobject in (C:\xampp\htdocs\glpi\vendor\sabre\vobject\lib) laminas/laminas-cache in (C:\xampp\htdocs\glpi\vendor\laminas\laminas-cache\src) laminas/laminas-i18n in (C:\xampp\htdocs\glpi\vendor\laminas\laminas-i18n\src) laminas/laminas-serializer in (C:\xampp\htdocs\glpi\vendor\laminas\laminas-serializer\src) monolog/monolog in (C:\xampp\htdocs\glpi\vendor\monolog\monolog\src\Monolog) sebastian/diff in (C:\xampp\htdocs\glpi\vendor\sebastian\diff\src) elvanto/litemoji in (C:\xampp\htdocs\glpi\vendor\elvanto\litemoji\src) symfony/console in (C:\xampp\htdocs\glpi\vendor\symfony\console) scssphp/scssphp in (C:\xampp\htdocs\glpi\vendor\scssphp\scssphp\src) laminas/laminas-mail in (C:\xampp\htdocs\glpi\vendor\laminas\laminas-mail\src\Protocol) laminas/laminas-mime in (C:\xampp\htdocs\glpi\vendor\laminas\laminas-mime\src) rlanvin/php-rrule in (C:\xampp\htdocs\glpi\vendor\rlanvin\php-rrule\src) blueimp/jquery-file-upload in (C:\xampp\htdocs\glpi\vendor\blueimp\jquery-file-upload\server\php) ramsey/uuid in (C:\xampp\htdocs\glpi\vendor\ramsey\uuid\src) psr/log in (C:\xampp\htdocs\glpi\vendor\psr\log\Psr\Log) psr/simple-cache in (C:\xampp\htdocs\glpi\vendor\psr\simple-cache\src) mexitek/phpcolors in (C:\xampp\htdocs\glpi\vendor\mexitek\phpcolors\src\Mexitek\PHPColors) guzzlehttp/guzzle in (C:\xampp\htdocs\glpi\plugins\scimplementation\vendor\guzzlehttp\guzzle\src) guzzlehttp/psr7 in (C:\xampp\htdocs\glpi\plugins\scimplementation\vendor\guzzlehttp\psr7\src) wapmorgan/unified-archive in (C:\xampp\htdocs\glpi\vendor\wapmorgan\unified-archive\src) paragonie/sodium_compat in (C:\xampp\htdocs\glpi\vendor\paragonie\sodium_compat\src)

Anything else?

No response

cedric-anne commented 2 years ago

Hi,

Please attach here the email (in .eml format) that cause the issue, so we can try to reproduce.

It may be due to a PHP bug (see https://github.com/php/php-src/issues/7980) which has been fixed only on PHP 8.x.

adamcios commented 2 years ago

Hi,

Please attach here the email (in .eml format) that cause the issue, so we can try to reproduce.

It may be due to a PHP bug (see php/php-src#7980) which has been fixed only on PHP 8.x.

I have nothing to import. each email is imported, there is nothing in the main mailbox, nothing in the GPLI in Settings> Recipients> List of unimported messages, everything is empty I have PHP 7.4.24, maybe I will update php

ftoledo commented 2 years ago

i have same issue on:

Distributor ID: Ubuntu Description: Ubuntu 20.04.2 LTS Release: 20.04 Codename: focal php -v PHP 7.4.3 (cli) (built: Mar 2 2022 15:36:52) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

cedric-anne commented 2 years ago

Please attach here the email (in .eml format) that cause the issue, so we can try to reproduce.

trasher commented 2 years ago

No feedback, closing

ftoledo commented 2 years ago

Hi @trasher, In my case, I have many messages in the mailbox, I can't identify which one is causing problems. Where would it be convenient to add a debug line so that it at least shows me the msgid or its subject? So you can identify it and attach it to this ticket. Thanks!

cedric-anne commented 2 years ago

This failure happens on message fetching, and at this point, the library we use does not give any information about the message (due to the fact that message is not fetched). The email that cause the issue is probably the older one in the list. Try to move you messages in another directory, then put them one by one on your collected folder until failure happens, so you will know which one cause it.

boisrobe commented 1 year ago

i tried to leave just one message in the inbox and always the same error *** Uncaught Exception Laminas\Mail\Header\Exception\InvalidArgumentException: Invalid header value detected in /var/www/glpi/vendor/laminas/laminas-mail/src/Header/GenericHeader.php at line 64

php -v PHP 8.0.24

glpi 9.5.9 debian 10

i have create a new connecteur imap (we use pop before) for O365. But stil error on parsing.

What is the solution ? upgrade linux ? upgrade php ? upgrade glpi ?

Thanks for help

cedric-anne commented 1 year ago

Please open a new issue an attach, in eml format, the email that cause the issue.

boisrobe commented 1 year ago

ok thanks, i have 50% message comming with the pb. I create a new issue but what is the solution of this ticket ?

cedric-anne commented 1 year ago

image

There was no solution proposed, as we were not able to investigate.

boisrobe commented 1 year ago

i create issue 9718 i put an zip of one of eml but many have the problem.

cedric-anne commented 1 year ago

i create issue 9718 i put an zip of one of eml but many have the problem.

Can you give a link to this issue ?

boisrobe commented 1 year ago

this this the link https://github.com/php/php-src/issues/9718 But the answer is very bad : We are not the Laminas Project. Please check their bug tracker at https://github.com/laminas/laminas-mail/issues. and my isssue is closed.

We are in reflexion in ESM product and my director wan't me to see other product cause he think GLPI is not a professional product. I try to demonstrate we can work with an glpi network uptodate and an ESN for additionnal support. With this answer i have no argument.

I contact infotel to have an quotation for glpi with support and installation but no response. isilog, matrix42, clarilog give us some quotation.

With this closed issue i will search by myselft :-(

cedric-anne commented 1 year ago

Please open a new issue using this form: https://github.com/glpi-project/glpi/issues/new?assignees=cedric-anne&labels=&template=bug_report.yml