glpi icon indicating copy to clipboard operation
glpi copied to clipboard

The input is not a valid email address. Use the basic format local-part@hostname

Open jcervantes-sipecom opened this issue 1 year ago • 4 comments

Code of Conduct

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

Is there an existing issue for this?

  • [x] I have searched the existing issues

Version

10.0.17

Bug description

I'm getting the error: Uncaught Exception Laminas\Mail\Exception\InvalidArgumentException: The input is not a valid email address. Use the basic format local-part@hostname when the Collector Receiver try to read the mail in the mailbox.

I review the followings tickets: https://github.com/glpi-project/glpi/issues/13427, https://github.com/glpi-project/glpi/issues/12818, https://github.com/glpi-project/glpi/issues/10312, https://github.com/glpi-project/glpi/pull/9672, https://github.com/glpi-project/glpi/pull/8531, and I found out that when there is an email in TO or CC that isn't in correctly format, the collector failed to add the follow-up, but it shouldn't happen the collector should bypass the incorrect email and just add the valid ones.

I have this case:

Image

Image

And the error logs in the next section

Relevant log output

glpiphplog.CRITICAL:   *** Uncaught Exception Laminas\Mail\Exception\InvalidArgumentException: The input is not a valid email address. Use the basic format local-part@hostname in /glpi/vendor/laminas/laminas-mail/src/Address.php at line 79
  Backtrace :
  vendor/laminas/laminas-mail/src/Address.php:50     Laminas\Mail\Address->__construct()
  ...inas-mail/src/Header/AbstractAddressList.php:92 Laminas\Mail\Address::fromString()
  :                                                  Laminas\Mail\Header\AbstractAddressList::Laminas\Mail\Header\{closure}()
  ...inas-mail/src/Header/AbstractAddressList.php:70 array_map()
  vendor/laminas/laminas-mail/src/Headers.php:556    Laminas\Mail\Header\AbstractAddressList::fromString()
  vendor/laminas/laminas-mail/src/Headers.php:282    Laminas\Mail\Headers->loadHeader()
  vendor/laminas/laminas-mail/src/Headers.php:102    Laminas\Mail\Headers->addHeaderLine()
  vendor/laminas/laminas-mime/src/Decode.php:162     Laminas\Mail\Headers::fromString()
  ...r/laminas/laminas-mail/src/Storage/Part.php:106 Laminas\Mime\Decode::splitMessage()
  ...laminas/laminas-mail/src/Storage/Message.php:47 Laminas\Mail\Storage\Part->__construct()
  ...r/laminas/laminas-mail/src/Storage/Imap.php:121 Laminas\Mail\Storage\Message->__construct()
  ...aminas-mail/src/Storage/AbstractStorage.php:270 Laminas\Mail\Storage\Imap->getMessage()
  src/MailCollector.php:780                          Laminas\Mail\Storage\AbstractStorage->current()
  src/MailCollector.php:1929                         MailCollector->collect()
  src/CronTask.php:1027                              MailCollector::cronMailgate()
  front/cron.php:87                                  CronTask::launch()

Page URL

No response

Steps To reproduce

No response

Your GLPI setup information

No response

Anything else?

No response

jcervantes-sipecom avatar Feb 20 '25 20:02 jcervantes-sipecom

I confirm the issue.

A patch similar to #12232 should be done to prevent this.

cedric-anne avatar Feb 25 '25 09:02 cedric-anne

Hi @cedric-anne, so this issue was resolved in the version 11.0.0? or which is the correct patch to apply? Thanks!

martinaluna avatar Nov 04 '25 21:11 martinaluna

This issue is still open, it's probably not fixed yet.

trasher avatar Nov 05 '25 05:11 trasher

Hi @cedric-anne, so this issue was resolved in the version 11.0.0? or which is the correct patch to apply? Thanks!

We did not found yet the time to fix it.

If you get this kind of invalid e-mail in your mailbox, you could try to find what application was used to sent it and report the issue to the application maintainer.

cedric-anne avatar Nov 05 '25 07:11 cedric-anne