[REF] Upgrade Net_SMTP Package and remove now unneded patches and move to using compo...
authorSeamus Lee <seamuslee001@gmail.com>
Sat, 8 Feb 2020 03:40:42 +0000 (14:40 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Sun, 16 Feb 2020 21:34:34 +0000 (08:34 +1100)
composer.json
composer.lock
tools/scripts/composer/net-smtp-fix.sh
tools/scripts/composer/patches/net-smtp-patch.patch [moved from tools/scripts/composer/patches/net-smtp-patch.txt with 57% similarity]
tools/scripts/composer/patches/net-smtp-php7-patch.txt [deleted file]
tools/scripts/composer/patches/net-smtp-ref-patch.txt [deleted file]
tools/scripts/composer/patches/net-smtp-tls-patch.txt [deleted file]

index df799befb56d1570e4fe47829a4e7da0b6896266..8bb5d61f1380f6bea00b5ebbc5cd7383fb6b11b0 100644 (file)
@@ -60,7 +60,7 @@
     "pear/validate_finance_creditcard": "dev-master",
     "civicrm/civicrm-cxn-rpc": "~0.19.01.08",
     "pear/auth_sasl": "1.1.0",
-    "pear/net_smtp": "1.6.*",
+    "pear/net_smtp": "1.9.*",
     "pear/net_socket": "1.0.*",
     "pear/mail": "^1.4",
     "civicrm/civicrm-setup": "~0.4.0",
         "Support PHPUnit 6+": "https://github.com/php-cache/integration-tests/commit/1ec7362962185df91d3d749bc3fa7e7b99cb9fc7.patch",
         "Add tests for binary data round trip": "https://github.com/php-cache/integration-tests/commit/89cd7068e83aa776774bfc44f6bcba858c085616.patch"
       },
+      "pear/net_smtp": {
+        "Add in CiviCRM custom error message for CRM-8744": "tools/scripts/composer/patches/net-smtp-patch.patch"
+      },
       "phpoffice/common": {
         "Fix handling of libxml_disable_entity_loader": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/phpoffice-common-xml-entity-fix.patch"
       },
index c2c102f70bdda8acde4803dba3b2342763668fef..a82aa24850f0e1b2b677f6cb893b8c971e945182 100644 (file)
         },
         {
             "name": "pear/net_smtp",
-            "version": "1.6.3",
+            "version": "1.9.0",
             "source": {
                 "type": "git",
                 "url": "https://github.com/pear/Net_SMTP.git",
-                "reference": "7b6240761adf6ee245098e238a25d5c35650d82c"
+                "reference": "f7fbc5808bfeba87c38e02ea4acc5243ffc9524e"
             },
             "dist": {
                 "type": "zip",
-                "url": "https://api.github.com/repos/pear/Net_SMTP/zipball/7b6240761adf6ee245098e238a25d5c35650d82c",
-                "reference": "7b6240761adf6ee245098e238a25d5c35650d82c",
+                "url": "https://api.github.com/repos/pear/Net_SMTP/zipball/f7fbc5808bfeba87c38e02ea4acc5243ffc9524e",
+                "reference": "f7fbc5808bfeba87c38e02ea4acc5243ffc9524e",
                 "shasum": ""
             },
             "require": {
-                "pear/net_socket": "*",
-                "pear/pear_exception": "*",
-                "php": ">=4.0.5"
+                "pear/net_socket": "@stable",
+                "pear/pear-core-minimal": "@stable",
+                "php": ">=5.4.0"
             },
             "require-dev": {
                 "phpunit/phpunit": "*"
                 "pear/auth_sasl": "Install optionally via your project's composer.json"
             },
             "type": "library",
+            "extra": {
+                "patches_applied": {
+                    "Add in CiviCRM custom error message for CRM-8744": "tools/scripts/composer/patches/net-smtp-patch.patch"
+                }
+            },
             "autoload": {
                 "psr-0": {
                     "Net": "./"
                 "./"
             ],
             "license": [
-                "PHP License"
+                "BSD-2-Clause"
             ],
             "authors": [
                 {
                     "name": "Jon Parise",
                     "email": "jon@php.net",
-                    "homepage": "http://www.indelible.org",
+                    "homepage": "https://www.indelible.org",
                     "role": "Lead"
                 },
                 {
                 }
             ],
             "description": "An implementation of the SMTP protocol",
-            "homepage": "http://pear.github.io/Net_SMTP/",
+            "homepage": "https://pear.github.io/Net_SMTP/",
             "keywords": [
                 "email",
                 "mail",
                 "smtp"
             ],
-            "time": "2015-08-02T17:20:17+00:00"
+            "time": "2019-11-30T23:40:31+00:00"
         },
         {
             "name": "pear/net_socket",
             "version": "3.0.0+php53",
             "dist": {
                 "type": "zip",
-                "url": "https://github.com/tplaner/When/archive/c1ec099f421bff354cc5c929f83b94031423fc80.zip"
+                "url": "https://github.com/tplaner/When/archive/c1ec099f421bff354cc5c929f83b94031423fc80.zip",
+                "reference": null,
+                "shasum": null
             },
             "require": {
                 "php": ">=5.3.0"
index aef79b3e305f18da8e765f522d447d1de46fd190..de72c24a7015ec0620a8346b6b2267a0e1d47906 100755 (executable)
@@ -23,20 +23,4 @@ function safe_delete() {
   done
 }
 
-
-##############################################################################
-# Add in CiviCRM custom error message for CRM-8744.
-if ! grep -q 'CRM-8744' vendor/pear/net_smtp/Net/SMTP.php; then
-  patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-patch.txt
-fi
-if ! grep -q '@STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT' vendor/pear/net_smtp/Net/SMTP.php; then
-  patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-tls-patch.txt
-fi
-if ! grep -q 'function __construct' vendor/pear/net_smtp/Net/SMTP.php; then
-  patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-php7-patch.txt
-fi
-if grep -q '&Auth_SASL::factory' vendor/pear/net_smtp/Net/SMTP.php; then
-  patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smtp-ref-patch.txt
-fi
-
 safe_delete vendor/pear/net_smtp/{README.rst,examples,phpdoc.sh,tests}
similarity index 57%
rename from tools/scripts/composer/patches/net-smtp-patch.txt
rename to tools/scripts/composer/patches/net-smtp-patch.patch
index 6b12048ca5f80ec55ae47040b183588f0ebaf02a..3a77c36792bdec24c8ba448a1fdae1f0159c9092 100644 (file)
@@ -1,15 +1,13 @@
---- SMTP.php   2017-01-15 05:19:55.000000000 +1100
-+++ SMTP.php.new       2017-05-20 09:01:52.832373840 +1000
-@@ -368,8 +368,10 @@
+--- Net/SMTP.php       2019-12-01 10:40:31.000000000 +1100
++++ Net/SMTP.php       2020-02-08 14:36:53.758318869 +1100
+@@ -376,7 +376,9 @@
              return true;
          }
-
--        return PEAR::raiseError('Invalid response code received from server',
--                                $this->_code, PEAR_ERROR_RETURN);
+-        return PEAR::raiseError('Invalid response code received from server', $this->code);
 +        // CRM-8744
 +        $errorMessage = 'Invalid response code received from SMTP server while sending email.  This is often caused by a misconfiguration in Outbound Email settings. Please verify the settings at Administer CiviCRM >> Global Settings >> Outbound Email (SMTP).';
-+        return PEAR::raiseError($errorMessage, $this->_code, PEAR_ERROR_RETURN);
-+
++        return PEAR::raiseError($errorMessage, $this->code, PEAR_ERROR_RETURN);
      }
-
      /**
diff --git a/tools/scripts/composer/patches/net-smtp-php7-patch.txt b/tools/scripts/composer/patches/net-smtp-php7-patch.txt
deleted file mode 100644 (file)
index 6ed1605..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
---- SMTP.php    2017-05-20 11:50:53.716664059 +1000
-+++ SMTP.php.new        2017-05-20 12:38:36.271530119 +1000
-@@ -167,7 +167,7 @@
-      * @access  public
-      * @since   1.0
-      */
--    function Net_SMTP($host = null, $port = null, $localhost = null,
-+    function __construct($host = null, $port = null, $localhost = null,
-         $pipelining = false, $timeout = 0, $socket_options = null)
-     {
-         if (isset($host)) {
diff --git a/tools/scripts/composer/patches/net-smtp-ref-patch.txt b/tools/scripts/composer/patches/net-smtp-ref-patch.txt
deleted file mode 100644 (file)
index 84f080d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
---- SMTP.php   2017-06-15 20:08:34.696988543 -0700
-+++ SMTP.php.new       2017-06-15 20:08:25.951703778 -0700
-@@ -732,7 +732,8 @@
-         }
-         $challenge = base64_decode($this->_arguments[0]);
--        $digest = &Auth_SASL::factory('digest-md5');
-+        // CRM-8597
-+        $digest = Auth_SASL::factory('digest-md5');
-         $auth_str = base64_encode($digest->getResponse($uid, $pwd, $challenge,
-                                                        $this->host, "smtp",
-                                                        $authz));
-@@ -784,7 +785,8 @@
-         }
-         $challenge = base64_decode($this->_arguments[0]);
--        $cram = &Auth_SASL::factory('cram-md5');
-+        // CRM-8597
-+        $cram = Auth_SASL::factory('cram-md5');
-         $auth_str = base64_encode($cram->getResponse($uid, $pwd, $challenge));
-         if (PEAR::isError($error = $this->_put($auth_str))) {
diff --git a/tools/scripts/composer/patches/net-smtp-tls-patch.txt b/tools/scripts/composer/patches/net-smtp-tls-patch.txt
deleted file mode 100644 (file)
index 3eb2122..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-diff --git a/Net/SMTP.php b/Net/SMTP.php
-index 28eae8c..8f4e92b 100644
---- a/Net/SMTP.php
-+++ b/Net/SMTP.php
-@@ -602,7 +602,17 @@
-             if (PEAR::isError($result = $this->_parseResponse(220))) {
-                 return $result;
-             }
--            if (PEAR::isError($result = $this->_socket->enableCrypto(true, STREAM_CRYPTO_METHOD_TLS_CLIENT))) {
-+            if (isset($this->_socket_options['ssl']['crypto_method'])) {
-+                $crypto_method = $this->_socket_options['ssl']['crypto_method'];
-+            } else {
-+                /* STREAM_CRYPTO_METHOD_TLS_ANY_CLIENT constant does not exist
-+                 * and STREAM_CRYPTO_METHOD_SSLv23_CLIENT constant is
-+                 * inconsistent across PHP versions. */
-+                $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT
-+                                 | @STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT
-+                                 | @STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
-+            }
-+            if (PEAR::isError($result = $this->_socket->enableCrypto(true, $crypto_method))) {
-                 return $result;
-             } elseif ($result !== true) {
-                 return PEAR::raiseError('STARTTLS failed');