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

glpiphplog.WARNING: *** PHP Warning (2): Undefined variable $data in /opt/glpi/vendor/laminas/laminas-mail/src/Protocol/Imap.php at line 598 #18767

Open
2 tasks done
alesnav opened this issue Jan 20, 2025 · 1 comment

Comments

@alesnav
Copy link

alesnav commented Jan 20, 2025

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

10.0.17

Bug description

GLPI can fetch emails but new tickets only shows the Email Subject. Also, no new email in the same ticket thread is loaded as a new message in the ticket, as all emails related to an already opened tickets remain in error status and are shown in page "/front/notimportedemail.php" as "Failed operation".

When trying to figure out what is causing this error, I looked at _log/php-errors.log file and saw that email body text are not read by GLPI, as the $data variable is showing an exception.

My GLPI implementation to read emails from Office 365 is not direct, as IMAP and POP are totally blocked in my company based on security reasons. Therefore, I can only connect via Microsoft Graph (not available in GLPI) or though DavMail (acting as an email protocol local proxy for IMAP/POP). So, GLPI is connected to DavMail using IMAP and then, DavMail is connnected to O365. I also tried the plugin "Oauth IMAP" but did not work in my case, as it requires port 993 and IMAP permissions over Office 365.

I was using 10.0.16, but I have just updated to 10.0.17 just to test if it was fixed.

I looked for this error and it seems that there's an old issue without any fix or recommendation: #16085

Relevant log output

[2025-01-20 15:58:11] glpiphplog.WARNING:   *** PHP Warning (2): Undefined variable $data in /opt/glpi/vendor/laminas/laminas-mail/src/Protocol/Imap.php at line 598
  Backtrace :
  ...r/laminas/laminas-mail/src/Storage/Imap.php:162 Laminas\Mail\Protocol\Imap->fetch()
  ...r/laminas/laminas-mail/src/Storage/Part.php:175 Laminas\Mail\Storage\Imap->getRawContent()
  ...r/laminas/laminas-mail/src/Storage/Part.php:249 Laminas\Mail\Storage\Part->cacheContent()
  ...r/laminas/laminas-mail/src/Storage/Part.php:471 Laminas\Mail\Storage\Part->countParts()
  src/MailCollector.php:1803                         Laminas\Mail\Storage\Part->rewind()
  src/MailCollector.php:1156                         MailCollector->getBody()
  src/MailCollector.php:817                          MailCollector->buildTicket()
  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

New ticket:

  1. mail receiver set up as IMAP
  2. Send a new email to GLPI mailbox
  3. GLPI will only read the Subject but not the email data/body, and will create a ticket using only the Title but the Description will be blank.
  4. Once created, the email will be marked as completed.

Existing ticket:

  1. mail receiver set up as IMAP
  2. Send a new email to GLPI mailbox, using an existing thread of a ticket
  3. GLPI fails during mail load process and the email is sent to notimportedemail.php, marked as "Failed operation".

Your GLPI setup information

Information about system installation and configuration
GLPI 10.0.17 ( => /opt/glpi)
Installation mode: TARBALL
Current language:en_GB

Server
 
Operating system: Linux vmwepglpi01 6.8.0-1020-azure #​23-Ubuntu SMP Mon Dec 9 16:58:58 UTC 2024 x86_64
PHP 8.3.6 apache2handler (Core, FFI, PDO, Phar, Reflection, SPL, SimpleXML, Zend OPcache, apache2handler, apcu, bcmath, bz2,
calendar, ctype, curl, date, dom, exif, fileinfo, filter, ftp, gd, gettext, hash, iconv, igbinary, imap, intl, json, ldap,
libxml, mbstring, mysqli, mysqlnd, openssl, pcre, pdo_mysql, posix, random, readline, redis, session, shmop, soap, sockets,
sodium, standard, sysvmsg, sysvsem, sysvshm, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, zlib)
Setup: max_execution_time="60" memory_limit="512M" post_max_size="20M" safe_mode="" session.save_handler="files"
upload_max_filesize="20M" disable_functions=""
Software: Apache/2.4.58 (Ubuntu) (Apache/2.4.58 (Ubuntu) Server at glpi.XXX.com Port 80
)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 Edg/132.0.0.0
Server Software: Source distribution
Server Version: 8.0.37-azure
Server SQL Mode: STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO
Parameters: [email protected]:3306/glpi
Host info: mysql-we-p-sociberia-002.mysql.database.azure.com via TCP/IP

PHP version (8.3.6) is supported.
Sessions configuration is OK.
Allocated memory is sufficient.
mysqli extension is installed.
Following extensions are installed: dom, fileinfo, filter, libxml, json, simplexml, xmlreader, xmlwriter.
curl extension is installed.
gd extension is installed.
intl extension is installed.
zlib extension is installed.
The constant SODIUM_CRYPTO_AEAD_XCHACHA20POLY1305_IETF_NPUBBYTES is present.
Database engine version (8.0.37) is supported.
No files from previous GLPI version detected.
The log file has been created successfully.
Write access to /opt/glpi/files/_cache has been validated.
Write access to /opt/glpi/files/_cron has been validated.
Write access to /opt/glpi/files has been validated.
Write access to /opt/glpi/files/_dumps has been validated.
Write access to /opt/glpi/files/_graphs has been validated.
Write access to /opt/glpi/files/_lock has been validated.
Write access to /opt/glpi/files/_pictures has been validated.
Write access to /opt/glpi/files/_plugins has been validated.
Write access to /opt/glpi/files/_rss has been validated.
Write access to /opt/glpi/files/_sessions has been validated.
Write access to /opt/glpi/files/_tmp has been validated.
Write access to /opt/glpi/files/_uploads has been validated.

Web server root directory configuration seems safe.
Sessions configuration is secured.
OS and PHP are relying on 64 bits integers.
exif extension is installed.
ldap extension is installed.
openssl extension is installed.
Following extensions are installed: bz2, Phar, zip.
Zend OPcache extension is installed.
Following extensions are installed: ctype, iconv, mbstring, sodium.
Write access to /opt/glpi/marketplace has been validated.
Access to timezone database (mysql) is not allowed.

GLPI constants
 
GLPI_ROOT: "/opt/glpi"
GLPI_CONFIG_DIR: "/opt/glpi/config"
GLPI_VAR_DIR: "/opt/glpi/files"
GLPI_MARKETPLACE_DIR: "/opt/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: false
GLPI_SERVERSIDE_URL_ALLOWLIST: ["/^(https?|feed):\/\/[^@:]+(\/.*)?$/"]
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_ALLOW_OVERRIDE: true
GLPI_MARKETPLACE_MANUAL_DOWNLOADS: true
GLPI_USER_AGENT_EXTRA_COMMENTS: ""
GLPI_DISABLE_ONLY_FULL_GROUP_BY_SQL_MODE: "1"
GLPI_AJAX_DASHBOARD: "1"
GLPI_CALDAV_IMPORT_STATE: 0
GLPI_DEMO_MODE: "0"
GLPI_CENTRAL_WARNINGS: "1"
GLPI_TEXT_MAXSIZE: "4000"
GLPI_DOC_DIR: "/opt/glpi/files"
GLPI_CACHE_DIR: "/opt/glpi/files/_cache"
GLPI_CRON_DIR: "/opt/glpi/files/_cron"
GLPI_DUMP_DIR: "/opt/glpi/files/_dumps"
GLPI_GRAPH_DIR: "/opt/glpi/files/_graphs"
GLPI_LOCAL_I18N_DIR: "/opt/glpi/files/_locales"
GLPI_LOCK_DIR: "/opt/glpi/files/_lock"
GLPI_LOG_DIR: "/opt/glpi/files/_log"
GLPI_PICTURE_DIR: "/opt/glpi/files/_pictures"
GLPI_PLUGIN_DOC_DIR: "/opt/glpi/files/_plugins"
GLPI_RSS_DIR: "/opt/glpi/files/_rss"
GLPI_SESSION_DIR: "/opt/glpi/files/_sessions"
GLPI_TMP_DIR: "/opt/glpi/files/_tmp"
GLPI_UPLOAD_DIR: "/opt/glpi/files/_uploads"
GLPI_INVENTORY_DIR: "/opt/glpi/files/_inventories"
GLPI_NETWORK_REGISTRATION_API_URL: "https://services.glpi-network.com/api/registration/"
GLPI_MARKETPLACE_PLUGINS_API_URI: "https://services.glpi-network.com/api/marketplace/"
GLPI_I18N_DIR: "/opt/glpi/locales"
GLPI_VERSION: "10.0.17"
GLPI_SCHEMA_VERSION: "10.0.17@bde16719fbd4112f59a9a7d34c66c959bce73434"
GLPI_MARKETPLACE_PRERELEASES: false
GLPI_MIN_PHP: "7.4.0"
GLPI_MAX_PHP: "8.4.0"
GLPI_YEAR: "2024"

Libraries
 
htmlawed/htmlawed version 1.2.14 in (/opt/glpi/vendor/htmlawed/htmlawed)
phpmailer/phpmailer version 6.8.0 in (/opt/glpi/vendor/phpmailer/phpmailer/src)
simplepie/simplepie version 1.5.8 in (/opt/glpi/vendor/simplepie/simplepie/library)
tecnickcom/tcpdf version 6.7.5 in (/opt/glpi/vendor/tecnickcom/tcpdf)
michelf/php-markdown in (/opt/glpi/vendor/michelf/php-markdown/Michelf)
true/punycode in (/opt/glpi/vendor/true/punycode/src)
iamcal/lib_autolink in (/opt/glpi/vendor/iamcal/lib_autolink)
sabre/dav in (/opt/glpi/vendor/sabre/dav/lib/DAV)
sabre/http in (/opt/glpi/vendor/sabre/http/lib)
sabre/uri in (/opt/glpi/vendor/sabre/uri/lib)
sabre/vobject in (/opt/glpi/vendor/sabre/vobject/lib)
laminas/laminas-i18n in (/opt/glpi/vendor/laminas/laminas-i18n/src)
laminas/laminas-servicemanager in (/opt/glpi/vendor/laminas/laminas-servicemanager/src)
monolog/monolog in (/opt/glpi/vendor/monolog/monolog/src/Monolog)
sebastian/diff in (/opt/glpi/vendor/sebastian/diff/src)
donatj/phpuseragentparser in (/opt/glpi/vendor/donatj/phpuseragentparser/src/UserAgent)
elvanto/litemoji in (/opt/glpi/vendor/elvanto/litemoji/src)
symfony/console in (/opt/glpi/vendor/symfony/console)
scssphp/scssphp in (/opt/glpi/vendor/scssphp/scssphp/src)
laminas/laminas-mail in (/opt/glpi/vendor/laminas/laminas-mail/src/Protocol)
laminas/laminas-mime in (/opt/glpi/vendor/laminas/laminas-mime/src)
rlanvin/php-rrule in (/opt/glpi/vendor/rlanvin/php-rrule/src)
ramsey/uuid in (/opt/glpi/vendor/ramsey/uuid/src)
psr/log in (/opt/glpi/vendor/psr/log/Psr/Log)
psr/simple-cache in (/opt/glpi/vendor/psr/simple-cache/src)
psr/cache in (/opt/glpi/vendor/psr/cache/src)
league/csv in (/opt/glpi/vendor/league/csv/src)
mexitek/phpcolors in (/opt/glpi/vendor/mexitek/phpcolors/src/Mexitek/PHPColors)
guzzlehttp/guzzle in (/opt/glpi/vendor/guzzlehttp/guzzle/src)
guzzlehttp/psr7 in (/opt/glpi/vendor/guzzlehttp/psr7/src)
glpi-project/inventory_format in (/opt/glpi/vendor/glpi-project/inventory_format/lib/php)
wapmorgan/unified-archive in (/opt/glpi/vendor/wapmorgan/unified-archive/src)
paragonie/sodium_compat in (/opt/glpi/vendor/paragonie/sodium_compat/src)
symfony/cache in (/opt/glpi/vendor/symfony/cache)
html2text/html2text in (/opt/glpi/vendor/html2text/html2text/src)
symfony/css-selector in (/opt/glpi/vendor/symfony/css-selector)
symfony/dom-crawler in (/opt/glpi/vendor/symfony/dom-crawler)
twig/twig in (/opt/glpi/vendor/twig/twig/src)
twig/string-extra in (/opt/glpi/vendor/twig/string-extra)
symfony/polyfill-ctype not found
symfony/polyfill-iconv not found
symfony/polyfill-mbstring not found
symfony/polyfill-php80 not found
symfony/polyfill-php81 not found
symfony/polyfill-php82 in (/opt/glpi/vendor/symfony/polyfill-php82)
league/oauth2-client in (/opt/glpi/vendor/league/oauth2-client/src/Provider)
league/oauth2-google in (/opt/glpi/vendor/league/oauth2-google/src/Provider)
thenetworg/oauth2-azure in (/opt/glpi/vendor/thenetworg/oauth2-azure/src/Provider)
phpCas version 1.6.0 in (/usr/share/php/CAS/source)

SQL replicas
 
Not active

Notifications
 
Way of sending emails: SMTP ([email protected])

Plugins list
 
activity Name: Activities Version: 3.1.5 State: Not installed
Install Method: Marketplace
fields Name: Additional fields Version: 1.21.18 State: Enabled
Install Method: Marketplace
tag Name: Administración de etiquetas Version: 2.12.1 State: Not installed
Install Method: Marketplace
datainjection Name: Data injection Version: 2.14.1 State: Enabled
Install Method: Marketplace
addressing Name: Direccionamiento IP Version: 3.0.2 State: Installed / not activated
Install Method: Marketplace
order Name: Gestión de Pedidos Version: 2.10.6 State: Installed / not activated
Install Method: Marketplace
glpiinventory Name: GLPI Inventory Version: 1.4.0 State: Enabled
Install Method: Marketplace
glpisaml Name: Glpisaml Version: 1.1.10 State: Enabled
Install Method: Marketplace
pdf Name: Impresión a pdf Version: 3.0.0 State: Installed / not activated
Install Method: Marketplace
mreporting Name: Más Informes Version: 1.8.6 State: Installed / not activated
Install Method: Marketplace
oauthimap Name: Oauth IMAP Version: 1.4.3 State: Not installed
Install Method: Marketplace
taskdrop Name: TaskDrop Version: 2.0.0 State: Not installed
Install Method: Marketplace
ticketfilter Name: Ticketfilter Version: 1.3.2 State: Enabled
Install Method: Marketplace
treeview Name: Tree view Version: 1.10.2 State: Installed / not activated
Install Method: Marketplace
yagp Name: YAGP Version: 2.3.1 State: Enabled
Install Method: Marketplace

Anything else?

No response

@alesnav
Copy link
Author

alesnav commented Jan 20, 2025

A "quick" workaround is to use POP instead of IMAP, just keeping in mind that folder concept is not supported in POP so only default INBOX folder could be used for this integration.

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

No branches or pull requests

1 participant