Skip to content

Commit

Permalink
[REF] Upgrade Net_SMTP Package and remove now unneded patches and mov…
Browse files Browse the repository at this point in the history
…e to using composer patches rather than patching in a script file
  • Loading branch information
seamuslee001 committed Feb 16, 2020
1 parent 11836db commit a6a0ff1
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 94 deletions.
5 changes: 4 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -242,6 +242,9 @@
"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"
},
Expand Down
31 changes: 19 additions & 12 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 0 additions & 16 deletions tools/scripts/composer/net-smtp-fix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Original file line number Diff line number Diff line change
@@ -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);
}

/**
11 changes: 0 additions & 11 deletions tools/scripts/composer/patches/net-smtp-php7-patch.txt

This file was deleted.

22 changes: 0 additions & 22 deletions tools/scripts/composer/patches/net-smtp-ref-patch.txt

This file was deleted.

23 changes: 0 additions & 23 deletions tools/scripts/composer/patches/net-smtp-tls-patch.txt

This file was deleted.

0 comments on commit a6a0ff1

Please sign in to comment.