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

Upgrade zetacomponents/base and zetacomponents/mail #13799

Merged
merged 3 commits into from
Mar 14, 2019

Conversation

mfb
Copy link
Contributor

@mfb mfb commented Mar 11, 2019

Overview

CiviCRM contains some pretty ancient versions of zetacomponents/base and zetacomponents/mail

Before

Using the 1.7 branch of zetacomponents/base and zetacomponents/mail

After

  • Upgrade zetacomponents/base to 1.9 branch and zetacomponents/mail to 1.8 branch (bug fixes and PHP 7.3 compatibility).
  • Handle the case of email body instance-of ezcMailFile when parsing emails.
  • Fix an incorrectly-encoded test fixture email (there now seems to be more strict decoding of email messages).

Comments

We also need to merge the Civi patches into the forked version of zetacomponents/mail; see civicrm/zetacomponents-mail#4

@civibot
Copy link

civibot bot commented Mar 11, 2019

(Standard links)

@mlutfy
Copy link
Member

mlutfy commented Mar 11, 2019

jenkins, test this please

@mfb
Copy link
Contributor Author

mfb commented Mar 11, 2019

ok we need to resolve this: Fatal error: Call to undefined method ezcMailFile::getParts() in /home/jenkins/bknix-dfl/build/core-13799-7jszs/sites/all/modules/civicrm/CRM/Utils/Mail/EmailProcessor.php on line 299

@mfb mfb force-pushed the zetacomponents branch from a2cd00c to 51b1143 Compare March 11, 2019 22:24
@mfb
Copy link
Contributor Author

mfb commented Mar 11, 2019

Found that a test fixture email had invalid quoted printable encoding, presumably from someone scrubbing identifying URL parameters by hand.

@mfb
Copy link
Contributor Author

mfb commented Mar 11, 2019

By the way, I noticed that this upgrade resolves some fatal errors on PHP 7.3, so I think it's high priority to get this in.

@mfb
Copy link
Contributor Author

mfb commented Mar 11, 2019

It looks like when a parsed email has a simple non-multipart body, it was previously an ezcMailText object, and is now an ezcMailFile object.

The library stores file parts in the system temp directory, and uses a shutdown callback to clean them up afterwards. They are stored in a directory based on process ID, for example for PID 4735, one email might have its body at /tmp/4735-1/filename and another might be /tmp/4735-3/filename.

As far as I can tell I am successfully working around it, by reading the body contents back from disk.

@eileenmcnaughton
Copy link
Contributor

My big worry was that we still need to support 5.6 however from their travis file it seems they do https://github.com/zetacomponents/Base/blob/master/.travis.yml

We also know we have some test cover on the component - as those tests failed triggering the related changes

I'm going to merge this

@eileenmcnaughton eileenmcnaughton merged commit 36c538f into civicrm:master Mar 14, 2019
@mfb
Copy link
Contributor Author

mfb commented Mar 14, 2019

@eileenmcnaughton we also need to merge civicrm/zetacomponents-mail#4 before this one. Otherwise the Civi patches won't be included.

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

Successfully merging this pull request may close these issues.

3 participants