mailanalyzer icon indicating copy to clipboard operation
mailanalyzer copied to clipboard

Follow-ups not received after updating to GLPI 10.0.19

Open daufveila opened this issue 7 months ago • 2 comments

Describe the bug

After upgrading to GLPI version 10.0.19, incoming emails are fetched successfully, but no follow-ups are created in tickets. The system logs repeated warnings about "duplicated document item relation", likely blocking the follow-up from being added.

Page(s) URL

N/A – occurs during mail processing via cron or manual collection.

To reproduce

  1. Upgrade to GLPI 10.0.19.
  2. Ensure MailCollector and MailAnalyzer plugin are enabled.
  3. Send an email reply to an existing ticket (e.g. from Outlook).
  4. Run the MailCollector (via cron.php or web UI).
  5. Check the ticket – no follow-up is created.
  6. Check the logs – warning about duplicated document item appears.

Expected behavior

The incoming email should be appended as a follow-up (ITILFollowup) to the corresponding ticket, even if it includes an attachment that was already linked.

Logs

[2025-07-21 10:41:47] glpiphplog.WARNING: *** PHP User Warning (512): Duplicated document item relation in /var/www/html/glpi/src/Document_Item.php at line 135
Backtrace:
  src/Document_Item.php:135 trigger_error()
  src/CommonDBTM.php:1302 Document_Item->prepareInputForAdd()
  src/CommonDBTM.php:5662 CommonDBTM->add()
  src/ITILFollowup.php:262 CommonDBTM->addFiles()
  src/CommonDBTM.php:1346 ITILFollowup->post_addItem()
  marketplace/mailanalyzer/hook.php:234 CommonDBTM->add()
  src/Plugin.php:1713 PluginMailAnalyzer::plugin_pre_item_add_mailanalyzer()
  src/CommonDBTM.php:1299 Plugin::doHook()
  src/MailCollector.php:935 CommonDBTM->add()
  front/mailcollector.form.php:106 MailCollector->collect()

Screenshots

Image

Your GLPI setup (you can find it in Setup > General menu, System tab)

GLPI version: 10.0.19
PHP version: 8.2.28
Webserver: Caddy
Database: MariaDB 10.11.11
Mail Analyzer plugin: 3.2.2
Oauth IMAP plugin: 1.4.3
Oauth provider: Microsoft Azure
Mail receiver: outlook.office365.com (IMAP with Oauth2)

Additional context

  • This issue did not occur in previous GLPI versions.
  • Seems to be triggered when the same document (attachment) is linked again during follow-up creation.
  • The error prevents the entire follow-up from being saved.
  • Likely caused by missing checks before attempting to link already-associated documents.

daufveila avatar Jul 21 '25 08:07 daufveila

Hello @daufveila, Could you post the initial email in EML format? Thank you Regards, Tomolimo

tomolimo avatar Jul 30 '25 14:07 tomolimo

Hello @tomolimo,

As requested, I've attached an .eml file that reproduces the issue.

In this case:

  • The ticket was initially created successfully from an email.
  • A follow-up email (reply) caused the warning:
    Duplicated document item relation
    and the follow-up was not added.

Let me know if you need further test samples.

AW_ Printer not working anymore.zip

Image

Best regards,
[daufveila]

daufveila avatar Aug 01 '25 11:08 daufveila