-
-
Notifications
You must be signed in to change notification settings - Fork 821
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
dev/core#5569 Remove obsolete zeta-patch #30969
Conversation
🤖 Thank you for contributing to CiviCRM! ❤️ We will need to test and review this PR. 👷 Introduction for new contributors...
Quick links for reviewers...
|
OK - so if failed - but trying to see if we can upstream - or at least be clearly trying zetacomponents/Mail#95 |
83d31b0
to
f5d15d6
Compare
@eileenmcnaughton I always thought that this patch was necessary because of our first custom patch |
@seamuslee001 yeah - our custom patch is weird - it seems like we broke the upstream for a specific thing that wasn't working for us? I'm trying to figure out if we have a test for that thing since it seems weird to hack an upstream package to not work right (per their tests) - or if we can just set |
The is identified in the comment as having been found in tests and in the PR as being a port of something already merged upstream civicrm#24019 so we should be able to drop it and if there were any issue tests would fail
f5d15d6
to
68c032d
Compare
@seamuslee001 the first custom patch links to the upstreamed one zetacomponents/Mail#86 |
So this is the report https://civicrm.stackexchange.com/questions/30511/auto-filing-e-mails-on-cases-mail-content-not-shown-under-details-and-attachmen It seems that there is a setting as to whether to treat text attachments as files & we don't want it to but rather than setting it to FALSE when we instantiate we are qualifying it...... |
hmm - I tried generating the emails the original patch was for in thunderbird & gmail & it looks a lot like the email applications may do things a bit more robustly than they did 5 years ago |
@demeritcowboy you were involved in the initial ticket do you have a feeling here? I'm not sure if they are all doing the right thing these days |
I've attached examples for the 2 clients from SE with both attached & generated - the next steps are
Worst case scenario we could combine the 2 patches into 1 as the first patch adds the bug the second fixe |
& just as I was typing super-responsive zetacomponents/Mail#95 (comment) |
What I remember is that attachments stopped working for filing inbound emails (I don't think it was specific to ics - I think that's a red herring further confused by the ".unknown" part which would have happened anyway with ics - my memory says it broke all attachments). The reason it broke was because zeta used to be forked, and live in its own repo. Then it was unforked, and in the process of doing that some civi-specific changes were dropped. In particular this one: civicrm/zetacomponents-mail@0401301, so it was added back as a composer patch. |
So in terms of confirming expectations, it's that attachments in inbound emails get filed properly, both their content and that ones that shouldn't be listed as ".unknown" aren't. I can try testing if that still happens without the patch. |
also @demeritcowboy I think it is that the content of emails as well isn't stored as an attachment but in the activity details section right? |
I wonder if this test fail is pointing to something
|
Looking at this https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/CRM/Utils/Mail/data/inbound/test_message_many_attachments.eml I suspect possibly what is happening here is that the Text/Plain and the text/Html parts are being converted into attachments as well as the 4 attached files |
I don't remember but the goal is that any multipart that isn't text/plain or text/html should get filed as an attachment in civi. If it's in the "safe" list of file types then it should have its normal filename, otherwise it should have .unknown. |
Yes probably - the text/plain and text/html should be in the details section. |
so I sent myself an email with 3 separate attachments 1 a PDF 1 a Word Doc and 1 a txt file
You will note for the .txt attachment the content type is text/plain so I think the purpose of our patch was to stop the body sections text/html and text/plain from being caught in the file processing instead only capture the actual attachments I think |
That sounds consistent with everything so far. |
Just confirming yes without the patch all inbound emails come in with .unknown attachments for the text and html parts instead of putting it in the details. |
Now how to explain this to derrick... although I don't think it's civi-specific really, because it makes sense that attachment dispositions should use the fileparser. |
@demeritcowboy this was my attempt on that zetacomponents/Mail#95 (comment) |
I think what it is that the setting "parseTextAttachmentsAsFiles" means "parse all text attachments as files, regardless of disposition", which yeah isn't quite what civi wants. Let's try just turning that off... |
@demeritcowboy I think turning it off would mean .txt attachments would show up in the activity details section right? but maybe we don't really get .txt attachments with emails these days or maybe .json ones? (not sure what json would attachment would show up on the content type) |
I'm hoping elsewhere somewhere it takes disposition into account regardless of content type when it's off. I'm trying it now. |
@demeritcowboy @seamuslee001 is it a problem with the library or our usage? ie should we be doing extra parsing on what zeta components return to decide how we want to store it in CiviCRM - ie should we be letting it convert to a file but then reading that file into the details section if it is of type @seamuslee001 did you try processing that text file into CiviCRM - I'm just wondering cos I thought the |
Yeah it's not that simple. It inserts it into the activity details. |
@eileenmcnaughton We could reparse it but not sure how much work it is offhand, since we still need to get at the disposition to determine what we want to do with it. The simplest patch seems like the one we have. Is it conflicting with something upstream? Why can't we keep it? |
I would vote for combining the two patches into 1, I don't see why we shouldn't keep the patch |
I think we should upstream it rather than carrying it forever as technical debt or else people will need to figure it out every now & then until we do (either due to updates or because people have unhacked versions with their CMS)- work deferred but not reduced. It would be different if the upstream maintainer had a history of being unresponsive but that is the opposite of the situation here I don't think it's hard to upstream it if we can articulate what we are trying to do. Probably we can negotiate a more nuanced meaning for |
OK - so with the email above
Scenario 1
** scenario 2** |
Closing this & returning to gitlab as I don't see it being reviewable anytime soon |
The is identified in the comment as having been found in tests and in the PR as being a port of something already merged upstream
#24019
so we should be able to drop it and if there were any issue tests would fail