-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Laminas mail expects a value in the format "type/subtype"; received "image/*" #119
Comments
Hi How to fix it...? |
It's rather unclear what are you even trying to do, what is the problem in question. |
Sorry. I will try to add full details. |
Looks like The XY Problem, you think the problem is about regex, but not described the actual problem. you need to make a reproducible scenario for a library like laminas-mail, with describing clearly what are the expectation. you can upload the reproducer as https://gist.github.com/ or (i think) attach a .zip file to issue tracker works too. the reproducer should be standalone and minimal to show clearly the problem. include copy of the email in question. |
Could this be causing a strange side effect of our incoming email tickets being given prior ticket numbers? |
Tried the adjustment above, having same effect as warmech777 There is def something wrong in here and I think it caused my prior issues, I'm going to go look at this files history. |
Well, this got rid of the errors in mailgate, but still having my issue of new tickets occasionally assigning to old ticket ID's. Looking else where. |
Ok, I'm bumping this issue since I've got the same situation while reading messages. It appears that 'Samsung Email on Android' generates an 'image/*' content-type for images. Here is a link to the gist: https://gist.github.com/rikvdh/489e13b22f9012db2dcd9f5046b53e43 |
The regex should be
instead of
as suggested on glpi-project/glpi#8375 (comment) |
Hello, |
Technically, this is a not a valid content type. RFC 2045 allows either IANA registered type or private subtype prefixed with However, as per RFC 2045 https://datatracker.ietf.org/doc/html/rfc2045#section-5.1
Overall, |
Hello @Xerkus |
This library is used for composing emails and it does not make a distinction between parsed non-conforming email and composed non-conforming email. Invalid composed emails can not be allowed. For this reason rejecting invalid email is preferable. |
Could it be then that an additional (optional) parameter can be used to inform the method that we are in the process of analyzing received emails, in order to differentiate composition or reception? |
I'm currently maintaining a fork with a lot of those exceptions commented out. I would like to think of something which could become mainline (like a function to turn those exceptions off). But this is quite convoluted when in your application message-decoding is 'abstracted' behind an 'imap-client' and some checks are deeper in other repo's. https://github.com/rikvdh/laminas-mail/tree/v2.25-non-strict |
This is the same case for us, we are using GLPI (= ITSM), which in turns is using laminas-mail for the emails input, see glpi-project/glpi#8375 |
Issue detected when using GLPI Mailgate glpi-project/glpi#8375 to get messages with attached files "image/*"
To fix this issue, the RegEx at the file "laminas-mail/src/Header/ContentType.php", line 114 should be changed to
/^[a-z-]+/[/*a-z0-9.+-]+$/i
The text was updated successfully, but these errors were encountered: