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

mailgate error with special characters #8529

Closed
Siruv opened this issue Jan 14, 2021 · 8 comments
Closed

mailgate error with special characters #8529

Siruv opened this issue Jan 14, 2021 · 8 comments

Comments

@Siruv
Copy link

Siruv commented Jan 14, 2021

Hello,

Since the update of GLPI to 9.5.3 from the old 9.4.X branch, the mail collector no longer works optimally.
Indeed, the attachments with accents, block the emails these are no longer downloaded by GLPI.
It is the same for emails with accents or special characters in their subject.

I'm not the only one, a topic has been opened on the forum:
https://forum.glpi-project.org/viewtopic.php?id=280106

Did you run into this problem as well?

Thank you for your answers.

Regards,

@trasher
Copy link
Contributor

trasher commented Jan 14, 2021

You should try with up to date current bugfixes branch (or latest nightly) and see if you reproduce.

If the issue is not solved in latest nightly build, please provide a test email that we can use in our test suite; in EML format only.

@lexx015
Copy link

lexx015 commented Feb 25, 2021

Hello!
We are have the same issue after migration from 9.4.6 to 9.5.3. I tried with:

  1. release version 9.5.3 with no luck
    so then i googled some information and made some patches to emails header verification
    after that we received 6 of 7 emails with "errors" but still had one email with errors

  2. nightly build also without a luck
    and final resolution was:
    skip emails verification in
    /usr/share/glpi/vendor/laminas/laminas-mail/src/Header/HeaderValue.php
    /usr/share/glpi/vendor/laminas/laminas-mail/src/Headers.php
    /usr/share/glpi/vendor/laminas/laminas-mail/src/Messages.php

I'am not care about any email verification in this way. I'am not care about blank lines in email headers or something like that, i just want to get emails.

So hope this will helps other to get emails.
Feel free to tell your results.

there is a patches to files, so just save it to files and use "patch" to apply them
or you can do this by editing files, first number is number of line in file

path to the /usr/share/glpi/vendor/laminas/laminas-mail/src/Messages.php

50c
return true;
.

path to the /usr/share/glpi/vendor/laminas/laminas-mail/src/Headers.php

97c
if ($emptyLine > 10) {
.
91c
if ($emptyLine > 20) {
.

/usr/share/glpi/vendor/laminas/laminas-mail/src/Header/HeaderValue.php

90c
return true;
.
83c
return true;
.
78c
return true;
.

@cedric-anne
Copy link
Member

Hi @lexx015 ,

Please provide an export of an email that causes this issues, in eml format, if you want us to investigate.

Regards

@lexx015
Copy link

lexx015 commented Feb 25, 2021

HI @cedric-anne!
Please tell me your email and I will forward you these emails as attachments.

@cedric-anne
Copy link
Member

HI @cedric-anne!
Please tell me your email and I will forward you these emails as attachments.

Hi,

I do not want to give my email address here.

By the way, I looked at your modifications and it seems that your problem is not the same as the one reported by @Siruv .
Indeed, it looks that some of the mails you tried to collect have no From header and/or invalid chars on headers. If you think these mails are not malformed, please open an issue on https://github.com/laminas/laminas-mail .

Regards

@cedric-anne
Copy link
Member

I close this issue has we had no feedback for the initial issue.

@Siruv
Copy link
Author

Siruv commented Mar 5, 2021

Hello,

I allow myself to reopen the ticket.
I could not test on a test environment for lack of time currently.
However, the problem encountered is that all the mails with special characters, accent, ... Both in the subject and the body of the message mean that GLPI does not absorb the mails.

I attach you in eml format various mails which can produce this bug. (I have removed the information relating to my domain)

Thank you for your answers.

Regards,

eml.zip

@cedric-anne
Copy link
Member

I take a look on the 2 provided emails.

11 mars - IBM répond aux questions des CRiPiens + RETEX DevOps Mainframe by Renault-Nisssan has an invalid Subject header. Indeed, it is not encoded but contains a special char. We will not try to handled malformed messages by ourselves.

The other message is correctly processed on 9.5.4.

Regards

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