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

GLPI 9.5.1 mailgate e queuenotifications não funcionam #7732

Closed
jehann opened this issue Jul 19, 2020 · 23 comments
Closed

GLPI 9.5.1 mailgate e queuenotifications não funcionam #7732

jehann opened this issue Jul 19, 2020 · 23 comments

Comments

@jehann
Copy link

jehann commented Jul 19, 2020

Eu utilizo o coletor de emails desde as versões 9.xx e tudo funcionou bem. Porém, quando eu atualizei para glpi 9.5.0, tive problemas. Depois disso, atualizei para a 9.5.1, funcionou apenas no dia da atualização mas depois voltou a apresentar o mesmo problema nos e-mails.

Enfim, problema em mailgate e queuenotifications nas versões 9.5.0 e 9.5.1. Nas duas versões não funcionam.

@cedric-anne
Copy link
Member

Hi,

Please use english please.

Regards

@jehann
Copy link
Author

jehann commented Jul 20, 2020

Excuse me! I'll try ...

I've been using the email collector since versions 9.xx and everything worked fine. However, when I upgraded to glpi 9.5.0, I had problems. After that, I upgraded to 9.5.1, it only worked on the day of the update, but then again presented the same problem in emails. When you click Get emails, a white screen opens. Clicking on run mailgate opens a white screen.

Anyway, problem with mailgate and queuenotifications in versions 9.5.0 and 9.5.1. Both versions do not work.

Please, I need help!

@fbcaetano
Copy link

No meu aparece este erro no PHP Erros

Percebi que tem a ver com anexo no email

[2020-07-20 11:45:24] glpiphplog.CRITICAL: *** Uncaught Exception Laminas\Mail\Header\Exception\InvalidArgumentException: Invalid header line for Content-Disposition string - incomplete continuation in /usr/share/glpi/vendor/laminas/laminas-mail/src/Header/ContentDisposition.php at line 84
Backtrace :
vendor/laminas/laminas-mail/src/Headers.php:485 Laminas\Mail\Header\ContentDisposition::fromString()
vendor/laminas/laminas-mail/src/Headers.php:232 Laminas\Mail\Headers->loadHeader()
vendor/laminas/laminas-mail/src/Headers.php:116 Laminas\Mail\Headers->addHeaderLine()
vendor/laminas/laminas-mime/src/Decode.php:150 Laminas\Mail\Headers::fromString()
vendor/laminas/laminas-mime/src/Decode.php:81 Laminas\Mime\Decode::splitMessage()
...r/laminas/laminas-mail/src/Storage/Part.php:194 Laminas\Mime\Decode::splitMessageStruct()
...r/laminas/laminas-mail/src/Storage/Part.php:256 Laminas\Mail\Storage\Part->cacheContent()
...r/laminas/laminas-mail/src/Storage/Part.php:471 Laminas\Mail\Storage\Part->countParts()
inc/mailcollector.class.php:1476 Laminas\Mail\Storage\Part->rewind()
inc/mailcollector.class.php:1635 MailCollector->getRecursiveAttached()
inc/mailcollector.class.php:966 MailCollector->getAttached()
inc/mailcollector.class.php:734 MailCollector->buildTicket()
inc/mailcollector.class.php:1740 MailCollector->collect()
inc/crontask.class.php:847 MailCollector::cronMailgate()
front/crontask.form.php:49 CronTask::launch()

@jehann
Copy link
Author

jehann commented Jul 20, 2020

Error that is displayed in php_errors.log:

glpiphplog.CRITICAL: *** Uncaught Exception Laminas\Mail\Storage\Exception\InvalidArgumentException: Header with Name to or to not found in www\glpi\vendor\laminas\laminas-mail\src\Storage\Part.php at line 307

@husisusi
Copy link

Try to move the mails from Mailbox to some subfolder, then try again!

@jehann
Copy link
Author

jehann commented Jul 20, 2020

I did not understand what this could contribute to the case. The problem is not in the e-mails inbox, but in the GLPI as reported error (php-errors.log).

@husisusi
Copy link

I did not understand what this could contribute to the case. The problem is not in the e-mails inbox, but in the GLPI as reported error (php-errors.log).

:) The Header is the problem.

@jehann
Copy link
Author

jehann commented Jul 20, 2020

Thank you very much. I did what you said and it worked again. Is there a risk of it happening again or is it now solved?

@husisusi
Copy link

It is GLPI Bug. But I thought it was fixed!
Move the mails one by one to inbox and find which one made this issue.

@cedric-anne
Copy link
Member

cedric-anne commented Jul 21, 2020

Error that is displayed in php_errors.log:

glpiphplog.CRITICAL: *** Uncaught Exception Laminas\Mail\Storage\Exception\InvalidArgumentException: Header with Name to or to not found in www\glpi\vendor\laminas\laminas-mail\src\Storage\Part.php at line 307

Hi @jehann ,

Can you provide the full log stack ?
I thought this bug was fixed in GLPI 9.5.1.

Regards

@cedric-anne
Copy link
Member

No meu aparece este erro no PHP Erros

Percebi que tem a ver com anexo no email

[2020-07-20 11:45:24] glpiphplog.CRITICAL: *** Uncaught Exception Laminas\Mail\Header\Exception\InvalidArgumentException: Invalid header line for Content-Disposition string - incomplete continuation in /usr/share/glpi/vendor/laminas/laminas-mail/src/Header/ContentDisposition.php at line 84
Backtrace :
vendor/laminas/laminas-mail/src/Headers.php:485 Laminas\Mail\Header\ContentDisposition::fromString()
vendor/laminas/laminas-mail/src/Headers.php:232 Laminas\Mail\Headers->loadHeader()
vendor/laminas/laminas-mail/src/Headers.php:116 Laminas\Mail\Headers->addHeaderLine()
vendor/laminas/laminas-mime/src/Decode.php:150 Laminas\Mail\Headers::fromString()
vendor/laminas/laminas-mime/src/Decode.php:81 Laminas\Mime\Decode::splitMessage()
...r/laminas/laminas-mail/src/Storage/Part.php:194 Laminas\Mime\Decode::splitMessageStruct()
...r/laminas/laminas-mail/src/Storage/Part.php:256 Laminas\Mail\Storage\Part->cacheContent()
...r/laminas/laminas-mail/src/Storage/Part.php:471 Laminas\Mail\Storage\Part->countParts()
inc/mailcollector.class.php:1476 Laminas\Mail\Storage\Part->rewind()
inc/mailcollector.class.php:1635 MailCollector->getRecursiveAttached()
inc/mailcollector.class.php:966 MailCollector->getAttached()
inc/mailcollector.class.php:734 MailCollector->buildTicket()
inc/mailcollector.class.php:1740 MailCollector->collect()
inc/crontask.class.php:847 MailCollector::cronMailgate()
front/crontask.form.php:49 CronTask::launch()

Hi @fbcaetano ,

Can you give us the eml export of the email causing this issue ?

Regards

@cedric-anne
Copy link
Member

cedric-anne commented Jul 21, 2020

@jehann

It seems that you had problems with password encryption/decryption. Try to re-enter the password the mail collector form and check if connection is working.
You can easilly check if connection params are correct by trying to display IMAP folder by clicking on the list icon located next to the incoming mail folder input element
image

Regards

@jehann
Copy link
Author

jehann commented Jul 21, 2020

Strange, because I didn't change the password after updating. In version 9.5.1, I had to enter the password again and it worked for a few hours and then it stopped working. Yesterday it returned to work after moving the emails of the inbox as suggested by the husisusi. At this point, it is functioning normally.

@jehann
Copy link
Author

jehann commented Jul 23, 2020

Hello! Today, mailgate has stopped working and displays the following messages:

Notice: Undefined index: users_id in ...\glpi\inc\mailcollector.class.php on line 741
Notice: Undefined index: _users_id_requester_notif in ...\glpi\inc\mailcollector.class.php on line 746

NOTE: Nothing has been changed in the GLPI to start displaying this message.

@jehann
Copy link
Author

jehann commented Jul 23, 2020

I have set up a rule for a long time so that when I receive a certain email, a call is automatically opened. The email has a pattern. I realized that the problem is happening with these emails after updating to version 9.5.1.

I already tried to mark the field with INBOX as mentioned by @ cedric-anne and with these emails in the inbox I have an error in the mailgate.

When moving these messages to another folder, as instructed by @husisusi, the mailgate will work again.

What can I do in these cases to resolve (GLPI open the ticket when receiving the email, as I did before the update)? Problem started only when I upgraded to versions 9.5.x.

Below the error when the mentioned email is in the inbox:

[2020-07-23 08:24:23] glpiphplog.CRITICAL: *** Uncaught Exception Laminas\Mail\Storage\Exception\InvalidArgumentException: Header with Name to or to not found in ...\glpi\vendor\laminas\laminas-mail\src\Storage\Part.php at line 307
Backtrace :
inc\mailcollector.class.php:1360 Laminas\Mail\Storage\Part->getHeader()
inc\mailcollector.class.php:912 MailCollector->getHeaders()
inc\mailcollector.class.php:711 MailCollector->buildTicket()
front\mailcollector.form.php:77 MailCollector->collect()

@husisusi
Copy link

@jehann
Again, find the mail that caused your issue. We need the Header of this Email.
Hide the sensitive data and post it.

@cedric-anne
Copy link
Member

Below the error when the mentioned email is in the inbox:

[2020-07-23 08:24:23] glpiphplog.CRITICAL: *** Uncaught Exception Laminas\Mail\Storage\Exception\InvalidArgumentException: Header with Name to or to not found in ...\glpi\vendor\laminas\laminas-mail\src\Storage\Part.php at line 307
Backtrace :
inc\mailcollector.class.php:1360 Laminas\Mail\Storage\Part->getHeader()
inc\mailcollector.class.php:912 MailCollector->getHeaders()
inc\mailcollector.class.php:711 MailCollector->buildTicket()
front\mailcollector.form.php:77 MailCollector->collect()

This error has been fixed in GLPI 9.5.1. Did you modified inc/mailcollector.class.php file ?

@cedric-anne
Copy link
Member

Hello! Today, mailgate has stopped working and displays the following messages:

Notice: Undefined index: users_id in ...\glpi\inc\mailcollector.class.php on line 741
Notice: Undefined index: _users_id_requester_notif in ...\glpi\inc\mailcollector.class.php on line 746

NOTE: Nothing has been changed in the GLPI to start displaying this message.

When an error occurs, we need the full stack trace to be able to analyze the problem correctly. Please provide it next time.

@husisusi
Copy link

@cedric-anne
Hi said his Version is GLPI 9.5.1!

@cedric-anne
Copy link
Member

@cedric-anne
Hi said his Version is GLPI 9.5.1!

And in GLPI 9.5.1, Laminas\Mail\Storage\Part->getHeader() is not called at inc\mailcollector.class.php:1360. So it seems that it is not a real 9.5.1 version.

@cedric-anne
Copy link
Member

@cedric-anne and @husisusi, I downloaded version 9.5.1 from github. I haven't touched anything in php code.

Can you compare your code with https://github.com/glpi-project/glpi/blob/9.5.1/inc/mailcollector.class.php ?

@jehann
Copy link
Author

jehann commented Jul 23, 2020

Can I copy this code (mailcollector.class.php) and replace the file?

I find it very strange, because I did a new installation. I didn't understand how this file got different.

@jehann
Copy link
Author

jehann commented Jul 23, 2020

I replaced the file and it went back to work. I realized that the date of the replaced file was not the same as the other files (version 9.5.1). Anyway, it worked again.

Thank you very much @cedric-anne and @husisusi for your attention, patience and help.

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

No branches or pull requests

4 participants