From 8a1794a904ce11035b4383416c922d590a0107f3 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Tue, 2 Apr 2019 11:15:36 +1100 Subject: [PATCH] Unfork Zetacomponents mail and use patch to apply differences --- composer.json | 11 +++----- composer.lock | 28 +++++++++++++------ ...rm-custom-patches-zetacompoents-mail.patch | 25 +++++++++++++++++ 3 files changed, 49 insertions(+), 15 deletions(-) create mode 100644 tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch diff --git a/composer.json b/composer.json index b3798a1bdb..fb0a915494 100644 --- a/composer.json +++ b/composer.json @@ -47,7 +47,7 @@ "tecnickcom/tcpdf" : "6.2.*", "totten/ca-config": "~17.05", "zetacomponents/base": "1.9.*", - "zetacomponents/mail": "dev-1.8-civi", + "zetacomponents/mail": "dev-master", "marcj/topsort": "~1.1", "phpoffice/phpword": "^0.15.0", "pear/validate_finance_creditcard": "dev-master", @@ -63,12 +63,6 @@ "pear/log": "1.13.1", "ezyang/htmlpurifier": "4.10" }, - "repositories": [ - { - "type": "git", - "url": "https://github.com/civicrm/zetacomponents-mail.git" - } - ], "scripts": { "post-install-cmd": [ "bash tools/scripts/composer/dompdf-cleanup.sh", @@ -94,6 +88,9 @@ }, "phpoffice/phpword": { "Fix handling of libxml_disable_entity_loader": "tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch" + }, + "zetacomponents/mail": { + "CiviCRM Custom Patches for ZetaCompoents mail": "tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch" } } } diff --git a/composer.lock b/composer.lock index 15c13094c4..4e2fd42aa8 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "bf8e79e6741fa30ccbc5bd59416f9f16", + "content-hash": "93a9f686f7eb00fb9d766d262eedb09b", "packages": [ { "name": "civicrm/civicrm-cxn-rpc", @@ -2308,11 +2308,17 @@ }, { "name": "zetacomponents/mail", - "version": "dev-1.8-civi", + "version": "dev-master", "source": { "type": "git", - "url": "https://github.com/civicrm/zetacomponents-mail.git", - "reference": "7286a167a4ec3199ab3c69a361967d853ffbcd90" + "url": "https://github.com/zetacomponents/Mail.git", + "reference": "b60e9a543f6c3d9a9ec74452d4ff5736a1c63a77" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/zetacomponents/Mail/zipball/b60e9a543f6c3d9a9ec74452d4ff5736a1c63a77", + "reference": "b60e9a543f6c3d9a9ec74452d4ff5736a1c63a77", + "shasum": "" }, "require": { "zetacomponents/base": "~1.8" @@ -2321,11 +2327,17 @@ "zetacomponents/unit-test": "*" }, "type": "library", + "extra": { + "patches_applied": { + "CiviCRM Custom Patches for ZetaCompoents mail": "tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch" + } + }, "autoload": { "classmap": [ "src" ] }, + "notification-url": "https://packagist.org/downloads/", "license": [ "Apache-2.0" ], @@ -2361,18 +2373,18 @@ "name": "Alexandru Stanoi" }, { - "name": "Sinisa Dukaric" + "name": "Christian Michel" }, { - "name": "Mikko Koppanen" + "name": "Sinisa Dukaric" }, { - "name": "Christian Michel" + "name": "Mikko Koppanen" } ], "description": "The component allows you construct and/or parse Mail messages conforming to the mail standard. It has support for attachments, multipart messages and HTML mail. It also interfaces with SMTP to send mail or IMAP, POP3 or mbox to retrieve e-mail.", "homepage": "https://github.com/zetacomponents", - "time": "2019-03-14T11:29:52+00:00" + "time": "2019-02-13T11:33:09+00:00" } ], "packages-dev": [], diff --git a/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch b/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch new file mode 100644 index 0000000000..effecbdbb0 --- /dev/null +++ b/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch @@ -0,0 +1,25 @@ +diff --git a/src/transports/imap/imap_transport.php b/src/transports/imap/imap_transport.php +index 94837cd..1542673 100644 +--- a/src/transports/imap/imap_transport.php ++++ b/src/transports/imap/imap_transport.php +@@ -1012,7 +1012,9 @@ class ezcMailImapTransport + { + // get the sizes of the messages + $tag = $this->getNextTag(); +- $query = trim( implode( ',', $messageList ) ); ++ $mailBatchSize = defined('MAIL_BATCH_SIZE') ? MAIL_BATCH_SIZE : 1000; ++ $truncatedMessageList = array_slice($messageList, 0, $mailBatchSize); ++ $query = trim( implode( ',', $truncatedMessageList ) ); + $this->connection->sendData( "{$tag} FETCH {$query} RFC822.SIZE" ); + $response = $this->getResponse( 'FETCH (' ); + $currentMessage = trim( reset( $messageList ) ); +diff --git a/tests/tutorial_examples.php b/tests/tutorial_examples.php +index 3acadc3..06f1e71 100644 +--- a/tests/tutorial_examples.php ++++ b/tests/tutorial_examples.php +@@ -1,5 +1,4 @@ +