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

Mail collector failing to import mails from senders with accent in their name #10312

Closed
2 tasks done
Zoddo opened this issue Jan 12, 2022 · 15 comments
Closed
2 tasks done
Labels

Comments

@Zoddo
Copy link

Zoddo commented Jan 12, 2022

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

GLPI 9.5.6

Bug description

After updating from GLPI 9.4.6 to GLPI 9.5.6, the mail collector fails to import some mails with the following error:
Uncaught Exception Laminas\Mail\Exception\InvalidArgumentException: 'company.com>d' is not a valid hostname for the email address in /var/www/glpi-956/vendor/laminas/laminas-mail/src/Address.php at line 78

This seems to impact mails from senders who have an accent in their display name (eg: "Frédéric").

Relevant log output

[2022-01-12 16:01:03] glpiphplog.CRITICAL:   *** Uncaught Exception Laminas\Mail\Exception\InvalidArgumentException: 'company.com>d' is not a valid hostname for the email address in /var/www/glpi-956/vendor/laminas/laminas-mail/src/Address.php at line 78
  Backtrace :
  vendor/laminas/laminas-mail/src/Address.php:54     Laminas\Mail\Address->__construct()
  ...inas-mail/src/Header/AbstractAddressList.php:87 Laminas\Mail\Address::fromString()
  :                                                  Laminas\Mail\Header\AbstractAddressList::Laminas\Mail\Header\{closure}()
  ...inas-mail/src/Header/AbstractAddressList.php:66 array_map()
  vendor/laminas/laminas-mail/src/Headers.php:548    Laminas\Mail\Header\AbstractAddressList::fromString()
  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:1755                   MailCollector->collect()
  inc/crontask.class.php:943                         MailCollector::cronMailgate()
  front/cron.php:83                                  CronTask::launch()

Page URL

No response

Steps To reproduce

  1. Create a mail collector (IMAP in our case)
  2. Send a mail from a sender who have an accent in their DisplayName (eg: "Frédéric")
  3. Trigger a mail collection
  4. Observes that the mail wasn't imported. The above error was logged in files/_log/php-errors.log

Your GLPI setup information

Setup Information
GLPI 9.5.6 (/glpi => /var/www/glpi-956)
Installation mode: TARBALL

Server
 
Operating system: Linux srvitm01 4.19.0-18-amd64 #1 SMP Debian 4.19.208-1 (2021-09-29) x86_64
PHP 7.3.31-1~deb10u1 apache2handler (Core, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, apc, apcu, bz2,
	calendar, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, http, iconv, imap, intl, json, ldap, libxml,
	mbstring, mysqli, mysqlnd, openssl, pcre, pdo_mysql, posix, propro, raphf, readline, session, shmop, soap, sockets, sodium,
	standard, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="600" memory_limit="256M" post_max_size="8M" safe_mode="" session.save_handler="files"
	upload_max_filesize="50M" 
Software: Apache/2.4.38 (Debian) (Apache/2.4.38 (Debian) Server at supportinfo Port 443)
	Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36
Server Software: Debian 10
	Server Version: 10.3.31-MariaDB-0+deb10u1
	Server SQL Mode: 
	Parameters: db-glpiprd@localhost/glpi
	Host info: Localhost via UNIX socket
	
PHP version is at least 7.2.0 - Perfect!PHP version is at least 7.2.0 - Perfect!
Sessions support is available - Perfect!Sessions support is available - Perfect!
Allocated memory > 64 Mio - Perfect!Allocated memory > 64 Mio - Perfect!
mysqli extension is installedmysqli extension is installed
ctype extension is installedctype extension is installed
fileinfo extension is installedfileinfo extension is installed
json extension is installedjson extension is installed
mbstring extension is installedmbstring extension is installed
iconv extension is installediconv extension is installed
zlib extension is installedzlib extension is installed
curl extension is installedcurl extension is installed
gd extension is installedgd extension is installed
simplexml extension is installedsimplexml extension is installed
intl extension is installedintl extension is installed
ldap extension is installedldap extension is installed
apcu extension is installedapcu extension is installed
Zend OPcache extension is installedZend OPcache extension is installed
xmlrpc extension is installedxmlrpc extension is installed
exif extension is installedexif extension is installed
zip extension is installedzip extension is installed
bz2 extension is installedbz2 extension is installed
sodium extension is installedsodium extension is installed
Database version seems correct (10.3.31) - Perfect!Database version seems correct (10.3.31) - Perfect!

The log file has been created successfully.The log file has been created successfully.
Write access to /var/www/glpi-956/files/_cache has been validated.Write access to /var/www/glpi-956/files/_cache has been validated.
Write access to /var/www/glpi-956/config has been validated.Write access to /var/www/glpi-956/config has been validated.
Write access to /var/www/glpi-956/files/_cron has been validated.Write access to /var/www/glpi-956/files/_cron has been validated.
Write access to /var/www/glpi-956/files has been validated.Write access to /var/www/glpi-956/files has been validated.
Write access to /var/www/glpi-956/files/_dumps has been validated.Write access to /var/www/glpi-956/files/_dumps has been validated.
Write access to /var/www/glpi-956/files/_graphs has been validated.Write access to /var/www/glpi-956/files/_graphs has been validated.
Write access to /var/www/glpi-956/files/_lock has been validated.Write access to /var/www/glpi-956/files/_lock has been validated.
Write access to /var/www/glpi-956/files/_pictures has been validated.Write access to /var/www/glpi-956/files/_pictures has been validated.
Write access to /var/www/glpi-956/files/_plugins has been validated.Write access to /var/www/glpi-956/files/_plugins has been validated.
Write access to /var/www/glpi-956/files/_rss has been validated.Write access to /var/www/glpi-956/files/_rss has been validated.
Write access to /var/www/glpi-956/files/_sessions has been validated.Write access to /var/www/glpi-956/files/_sessions has been validated.
Write access to /var/www/glpi-956/files/_tmp has been validated.Write access to /var/www/glpi-956/files/_tmp has been validated.
Write access to /var/www/glpi-956/files/_uploads has been validated.Write access to /var/www/glpi-956/files/_uploads has been validated.
Write access to /var/www/glpi-956/marketplace has been validated.Write access to /var/www/glpi-956/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 (/glpi/files/_log/php-errors.log) is forbidden; otherwise review .htaccess file and web server configuration.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 (/glpi/files/_log/php-errors.log) is forbidden; otherwise review .htaccess file and web server configuration.

GLPI constants
 
GLPI_ROOT: /var/www/glpi-956
GLPI_CONFIG_DIR: /var/www/glpi-956/config
GLPI_VAR_DIR: /var/www/glpi-956/files
GLPI_MARKETPLACE_DIR: /var/www/glpi-956/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: [email protected]
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: /var/www/glpi-956/files
GLPI_CACHE_DIR: /var/www/glpi-956/files/_cache
GLPI_CRON_DIR: /var/www/glpi-956/files/_cron
GLPI_DUMP_DIR: /var/www/glpi-956/files/_dumps
GLPI_GRAPH_DIR: /var/www/glpi-956/files/_graphs
GLPI_LOCAL_I18N_DIR: /var/www/glpi-956/files/_locales
GLPI_LOCK_DIR: /var/www/glpi-956/files/_lock
GLPI_LOG_DIR: /var/www/glpi-956/files/_log
GLPI_PICTURE_DIR: /var/www/glpi-956/files/_pictures
GLPI_PLUGIN_DOC_DIR: /var/www/glpi-956/files/_plugins
GLPI_RSS_DIR: /var/www/glpi-956/files/_rss
GLPI_SESSION_DIR: /var/www/glpi-956/files/_sessions
GLPI_TMP_DIR: /var/www/glpi-956/files/_tmp
GLPI_UPLOAD_DIR: /var/www/glpi-956/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: /var/www/glpi-956/locales
GLPI_VERSION: 9.5.6
GLPI_SCHEMA_VERSION: 9.5.6
GLPI_MIN_PHP: 7.2.0
GLPI_YEAR: 2021

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

LDAP directories
 
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs_bluebus,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=Utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs,OU=[redacted],DC=[redacted],DC=net', Connection filter: none, RootDN:
		'CN=authldap,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net ', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'OU=utilisateurs_invites_du_domaine,OU=[redacted],DC=[redacted],DC=net', Connection filter:
		none, RootDN: 'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use TLS: none
Server: '[redacted].net', Port: '389', BaseDN: 'DC=[redacted],DC=net', Connection filter: '(memberOf=CN=APP_GLPI,OU=groupe
		d'appli,OU=groupes,OU=[redacted],DC=[redacted],DC=net)', RootDN: 'CN=authLDAP,OU=Utilisateurs génériques,OU=[redacted],DC=[redacted],DC=net', Use
		TLS: none

SQL replicas
 
Not active

Notifications
 
Way of sending emails: SMTP (anonymous@smtp.[redacted].com)

Mails receivers
 
Name: 'support.info@[redacted].com - Office365' Active: Yes
	Server: '{outlook.office365.com/imap-oauth-1/ssl}INBOX' Login: 'Support.info@[redacted].com' Password: Yes
Name: 'support.info@[redacted].com' Active: No
	Server: '{srvdcmes02.[redacted].net:993/imap/ssl/novalidate-cert}INBOX' Login: 'sinfo' Password: Yes

Plugins list
 
	news                 Name: Alertes                        Version: 1.9.0      State: Enabled
	screenshot           Name: Capture d'écran                Version: 1.1.6      State: Enabled
	fields               Name: Champs supplémentaires         Version: 1.12.8     State: Enabled
	escalade             Name: Escalades                      Version: 2.7.1      State: Enabled
	formcreator          Name: Form Creator                   Version: 2.12.3     State: Enabled
	order                Name: Gestion des commandes          Version: 2.7.3      State: Enabled
	tag                  Name: Gestion des tags               Version: 2.8.1      State: Enabled
	manufacturersimports Name: Imports fabricants             Version: 2.3.1      State: Enabled
	pdf                  Name: Impression pdf                 Version: 2.0.0      State: Enabled
	tasklists            Name: Liste des tâches               Version: 1.6.2      State: Enabled
	moreticket           Name: More ticket                    Version: 1.6.1      State: Enabled
	oauthimap            Name: Oauth IMAP                     Version: 1.3.0      State: Enabled
	ocsinventoryng       Name: OCS Inventory NG               Version: 1.7.3      State: Enabled
	reservation          Name: Reservation                    Version: 2.3.6      State: Enabled
	dashboard            Name: Tableau de bord                Version: 1.0.2      State: Enabled
	ticketcleaner        Name: Ticket Cleaner                 Version: 3.0.0      State: Enabled

OCS Inventory NG
Host: localhost
Connection: Ok
Use the OCSNG software dictionary: Yes

Anything else?

I can provide the full headers of an affected mail privately, if needed.

@Zoddo
Copy link
Author

Zoddo commented Jan 12, 2022

FYI, I found these issues before opening this one, but they were abandoned and have been closed: #8513 & #9280

@cedric-anne
Copy link
Member

Hi,

Please attach email that causes this issue in eml format, so we could invastigate on it.

Regards

@Zoddo
Copy link
Author

Zoddo commented Jan 12, 2022

Is there a way to send this to you privately?

@davidvalter
Copy link

davidvalter commented Jan 13, 2022

Hello dear!
First, I apologize for my English.

Apparently, I'm experiencing the same problem. I searched in several places but without success. I will also post my Logs here and attach the EML file.

I think in my case it refers to the treatment of single quotes and double quotes. ' or '' .

files/_log/mailgate.log:
Message is invalid ('futuraarquitetos.com.br'' is not a valid hostname for the email address).

EML Header

From: Cristiano Francisco do Nascimento
	<[email protected]>
To: "'[email protected]'" <[email protected]>
CC: =?iso-8859-1?Q?Setor_de_Prote=E7=E3o_=E0_Pessoas_e_ao_Patrim=F4nio?=
	<[email protected]>,
	<[email protected]>, "'[email protected]'"
	<'[email protected]'>,
	"[email protected]"
	<[email protected]>, Igor Alves de Sousa
	<[email protected]>, =?iso-8859-1?Q?Andr=E9_Santos_da_Silva?=
	"'[email protected]'"
	<[email protected]>, Fernando Rodrigues
	<[email protected]>
Subject: =?iso-8859-1?Q?Lentid=E3o_e_travamento_nos_computadores_do_monitoramento?=
Thread-Topic: =?iso-8859-1?Q?Lentid=E3o_e_travamento_nos_computadores_do_monitoramento?=

@cedric-anne
Copy link
Member

Hi,

Unless I miss something, <'[email protected]'> is not a valid email adress, quotes should not be there.

Regards

@cedric-anne
Copy link
Member

Is there a way to send this to you privately?

You can try to :

  • configure thunderbird to access you collected mailbox using IMAP,
  • save your email into eml using Thunderbird (File > Save as > File),
  • edit the eml file to remove sensitive data,
  • reopen the eml file into Thunderbird (File > Open > Saved message...), and copy it to the collected mailbox (Message > Copy To > ...).

If the altered message reproduces the issue, then you could attach it here, and we could use it in our test suite.

@antoniobuiza
Copy link

Hi! my 9.5.6 platform is getting same error. The mail connector imports all the emails avoiding those with errors but when the mailbox have 10 of them te mailer do not import any more.
I have to purgue the mailbox for mailer continuing importing new items.

Last php-errors.log entry:

[2022-01-17 07:54:53] glpiphplog.CRITICAL: *** Uncaught Exception Laminas\Mail\Exception\InvalidArgumentException: 'domain.com'' is not a valid hostname for the email address in D:\HTTPD\GLPI.RIPOLLET.CAT\vendor\laminas\laminas-mail\src\Address.php at line 78 Backtrace : vendor\laminas\laminas-mail\src\Address.php:54 Laminas\Mail\Address->__construct() ...inas-mail\src\Header\AbstractAddressList.php:87 Laminas\Mail\Address::fromString() : Laminas\Mail\Header\AbstractAddressList::Laminas\Mail\Header\{closure}() ...inas-mail\src\Header\AbstractAddressList.php:89 array_map() vendor\laminas\laminas-mail\src\Headers.php:548 Laminas\Mail\Header\AbstractAddressList::fromString() 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:1755 MailCollector->collect() inc\crontask.class.php:943 MailCollector::cronMailgate() front\cron.php:83 CronTask::launch()

Thanks a lot!

@felag
Copy link

felag commented Jan 20, 2022

I encounter same bug on a customer installation with GLPi 9.5.6.

If it can help, here is some anonymized data.

I had to change mail headers from:

From: =?windows-1258?Q?DSI_Charg=E9_de_Formation_Jean_Dupont?=
	<[email protected]>
To: "Company ([email protected])" <[email protected]>

By:

From: DSI_Charge_de_Formation_Jean_Dupont
	<[email protected]>
To: "Company ([email protected])" <[email protected]>

@cedric-anne
Copy link
Member

Hi @felag ,

Could you please provide an email that causes this issue into eml format ?

Regards

@cconard96
Copy link
Contributor

Possibly related to this issue reported in the validator component used by the email library used by GLPI.
laminas/laminas-validator#21

@cconard96 cconard96 added the bug label Jan 20, 2022
@felag
Copy link

felag commented Jan 21, 2022

Hello @cedric-anne

Could you please provide an email that causes this issue into eml format ?

I am reluctant to send you such a mail: it comes from a customer of my customer working on health issues, so privacy is a high priority here. :-/

Isn't my extract from above enough to reproduce the bug on your side ?

@cedric-anne
Copy link
Member

@felag

I do not know if the header is valid in your case, but, when parsed using PHP native function iconv_mime_decode, result is incorrect (DSI Chargé de Formation Jean Dupon <[email protected]>t).

I opened a bug on PHP side, see php/php-src#7980 . We cannot do anymore on GLPI side.

Regards

@felag
Copy link

felag commented Jan 21, 2022

Hello @cconard96,

Possibly related to this issue reported in the validator component used by the email library used by GLPI.[…]

Work-around did not work on test platform, although it goes a little further:

  • no more lamina error message in php-errors.log
  • (when pressing Get emails tickets now on collector's Action tab) red error box now indicates root error reason.
    In my case: Invalid email address DSI Chargé de Formation Jean Dupon t (please note space char before ending t)

@cedric-anne
Copy link
Member

Hi,

It has been fixed on PHP side and will be available in next PHP bugfix release, see php/php-src@86c196b .

I close this as we cannot do much more on GLPI side.

Regards

@cedric-anne
Copy link
Member

For information, this bug has been fixed in PHP 8.0.17 and 8.1.4 releases published last week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants