diff --git a/civicrm.php b/civicrm.php
index 764ad4b51c87e758bbe6c8ed72df7630c8360090..c5f5ccbcd8b5ba00c1a7523eabac0d66dc6a8985 100644
--- a/civicrm.php
+++ b/civicrm.php
@@ -2,14 +2,12 @@
 /**
  * Plugin Name: CiviCRM
  * Description: CiviCRM - Growing and Sustaining Relationships
- * Version: 5.38.0
+ * Version: 5.38.1
  * Requires at least: 4.9
  * Requires PHP:      7.2
  * Author: CiviCRM LLC
  * Author URI: https://civicrm.org/
  * Plugin URI: https://docs.civicrm.org/sysadmin/en/latest/install/wordpress/
- * GitHub Plugin URI: tadpolecc/civicrm
- * GitHub Plugin URI: https://github.com/tadpolecc/civicrm.git
  * License: AGPL3
  * Text Domain: civicrm
  * Domain Path: /languages
@@ -56,7 +54,7 @@ if (!defined('ABSPATH')) {
 }
 
 // Set version here: when it changes, will force Javascript & CSS to reload.
-define('CIVICRM_PLUGIN_VERSION', '5.38.0');
+define('CIVICRM_PLUGIN_VERSION', '5.38.1');
 
 // Store reference to this file.
 if (!defined('CIVICRM_PLUGIN_FILE')) {
diff --git a/civicrm/CRM/Event/BAO/Event.php b/civicrm/CRM/Event/BAO/Event.php
index 267a00644f37c1715e74a9f0c0ca8d0560993779..01aba26a8b02afd6c152122e1d7d06e861d87a0f 100644
--- a/civicrm/CRM/Event/BAO/Event.php
+++ b/civicrm/CRM/Event/BAO/Event.php
@@ -994,6 +994,15 @@ WHERE civicrm_event.is_active = 1
     $copyEvent->save();
 
     if ($blockCopyOfCustomValue) {
+      foreach ($params['custom'] as &$values) {
+        foreach ($values as &$value) {
+          // Ensure we don't copy over the template's id if it is passed in
+          // This is a bit hacky but it's unclear what the
+          // right behaviour is given the whole 'custom'
+          // field is form layer formatting that is reaching the BAO.
+          $value['id'] = NULL;
+        }
+      }
       CRM_Core_BAO_CustomValueTable::store($params['custom'], 'civicrm_event', $copyEvent->id);
     }
 
diff --git a/civicrm/CRM/Export/Controller/Standalone.php b/civicrm/CRM/Export/Controller/Standalone.php
index aa954ee0e6dbaad945230f803d9b8563a8eb9bca..4e38d4a9d400fb894b3aafeaa3d47c8b12d18be1 100644
--- a/civicrm/CRM/Export/Controller/Standalone.php
+++ b/civicrm/CRM/Export/Controller/Standalone.php
@@ -72,7 +72,7 @@ class CRM_Export_Controller_Standalone extends CRM_Core_Controller {
     $className = 'CRM_' . $this->getComponent($this->get('entity')) . '_Task';
     foreach ($className::tasks() as $taskId => $task) {
       $taskForm = (array) $task['class'];
-      if (strpos($taskForm[0], 'CRM_Export_Form_Select') === 0) {
+      if (strpos($taskForm[0], '_Export_Form_Select') !== FALSE) {
         $values['task'] = $taskId;
       }
     }
diff --git a/civicrm/CRM/Financial/Form/PaymentEdit.php b/civicrm/CRM/Financial/Form/PaymentEdit.php
index be09c71c26288e294baad582db82fa5423298284..e0f30ed75efa289fe334b6951935ed8edb900be4 100644
--- a/civicrm/CRM/Financial/Form/PaymentEdit.php
+++ b/civicrm/CRM/Financial/Form/PaymentEdit.php
@@ -175,7 +175,7 @@ class CRM_Financial_Form_PaymentEdit extends CRM_Core_Form {
     $contactId = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution', $this->getContributionID(), 'contact_id');
     $url = CRM_Utils_System::url(
       "civicrm/contact/view/contribution",
-      "reset=1&action=update&id={" . $this->getContributionID() . "}&cid={$contactId}&context=contribution"
+      "reset=1&action=update&id=" . $this->getContributionID() . "&cid={$contactId}&context=contribution"
     );
     CRM_Core_Session::singleton()->pushUserContext($url);
   }
diff --git a/civicrm/CRM/Member/Form/MembershipRenewal.php b/civicrm/CRM/Member/Form/MembershipRenewal.php
index e233464f4bafef2986fa86355503416173927d23..4b0fdbe072049c42a483f900a90babfb0ec333e7 100644
--- a/civicrm/CRM/Member/Form/MembershipRenewal.php
+++ b/civicrm/CRM/Member/Form/MembershipRenewal.php
@@ -553,6 +553,8 @@ class CRM_Member_Form_MembershipRenewal extends CRM_Member_Form {
         $paymentParams = array_merge($paymentParams, $contributionRecurParams);
       }
 
+      $paymentParams['invoiceID'] = $paymentParams['invoice_id'];
+
       $payment = $this->_paymentProcessor['object'];
       $result = $payment->doPayment($paymentParams);
       $this->_params = array_merge($this->_params, $result);
diff --git a/civicrm/civicrm-version.php b/civicrm/civicrm-version.php
index 996efe89ccde11fd852cc6c97bc1fc84694a2c8b..1c0e07ed4c0b033588f48ae6dabcc310a8b0bbfe 100644
--- a/civicrm/civicrm-version.php
+++ b/civicrm/civicrm-version.php
@@ -1,7 +1,7 @@
 <?php
 /** @deprecated */
 function civicrmVersion( ) {
-  return array( 'version'  => '5.38.0',
+  return array( 'version'  => '5.38.1',
                 'cms'      => 'Wordpress',
                 'revision' => '' );
 }
diff --git a/civicrm/composer.json b/civicrm/composer.json
index 58e03fcb964636af2cd7f6aaa5091f5acfd478da..28d6eb4832e404822151575e2d81f4253acb16a7 100644
--- a/civicrm/composer.json
+++ b/civicrm/composer.json
@@ -288,7 +288,8 @@
         "Fix handling of libxml_disable_entity_loader": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch"
       },
       "zetacomponents/mail": {
-        "CiviCRM Custom Patches for ZetaCompoents mail": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch"
+        "CiviCRM Custom Patches for ZetaCompoents mail": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch",
+        "Allow single quotes to be used in return path": "https://github.com/zetacomponents/Mail/pull/86.patch"
       }
     },
     "compile-includes": ["ext/greenwich/composer.compile.json"],
diff --git a/civicrm/composer.lock b/civicrm/composer.lock
index 4a91e6e55edfcc377e7388eec363edff5d0c9c77..2db336efc9372911014ce97dc5dc93a7f806ae2b 100644
--- a/civicrm/composer.lock
+++ b/civicrm/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": "439af216e22a835897b747b0773da717",
+    "content-hash": "d3072858bd39b61c20a204de8000e68f",
     "packages": [
         {
             "name": "adrienrn/php-mimetyper",
@@ -3977,11 +3977,6 @@
                 "zetacomponents/unit-test": "*"
             },
             "type": "library",
-            "extra": {
-                "patches_applied": {
-                    "CiviCRM Custom Patches for ZetaCompoents mail": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch"
-                }
-            },
             "autoload": {
                 "classmap": [
                     "src"
@@ -4034,6 +4029,10 @@
             ],
             "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",
+            "support": {
+                "issues": "https://github.com/zetacomponents/Mail/issues",
+                "source": "https://github.com/zetacomponents/Mail/tree/1.9.2"
+            },
             "time": "2020-06-13T12:38:26+00:00"
         }
     ],
diff --git a/civicrm/release-notes.md b/civicrm/release-notes.md
index 7c5b49546b3b7cb2fc0f229ea5893e23a3e6c1de..1d11e5516e1797d2f7c7f66d29046a29e2619b54 100644
--- a/civicrm/release-notes.md
+++ b/civicrm/release-notes.md
@@ -15,6 +15,15 @@ Other resources for identifying changes are:
     * https://github.com/civicrm/civicrm-joomla
     * https://github.com/civicrm/civicrm-wordpress
 
+## CiviCRM 5.38.1
+
+Released June 30, 2021
+
+- **[Synopsis](release-notes/5.38.1.md#synopsis)**
+- **[Bugs resolved](release-notes/5.38.1.md#bugs)**
+- **[Credits](release-notes/5.38.1.md#credits)**
+- **[Feedback](release-notes/5.38.1.md#feedback)**
+
 ## CiviCRM 5.38.0
 
 Released June 2, 2021
diff --git a/civicrm/release-notes/5.38.1.md b/civicrm/release-notes/5.38.1.md
new file mode 100644
index 0000000000000000000000000000000000000000..b876bfb9f1d92b4800871c4a45261910657095e7
--- /dev/null
+++ b/civicrm/release-notes/5.38.1.md
@@ -0,0 +1,40 @@
+# CiviCRM 5.38.1
+
+Released June 30, 2021
+
+- **[Synopsis](#synopsis)**
+- **[Bugs resolved](#bugs)**
+- **[Credits](#credits)**
+- **[Feedback](#feedback)**
+
+## <a name="synopsis"></a>Synopsis
+
+| *Does this version...?*                                         |          |
+| --------------------------------------------------------------- | -------- |
+| Change the database schema?                                     | no       |
+| Alter the API?                                                  | no       |
+| Require attention to configuration options?                     | no       |
+| Fix problems installing or upgrading to a previous version?     | no       |
+| Introduce features?                                             | no       |
+| **Fix bugs?**                                                   | **yes**  |
+
+## <a name="bugs"></a>Bugs resolved
+
+* **_CiviContribute_: "Edit Payment" screen has malformed return URL ([#20699](https://github.com/civicrm/civicrm-core/pull/20699), [#20641](https://github.com/civicrm/civicrm-core/pull/20641))**
+* **_CiviEvent_: Data from custom fields incorrectly diverted to EventTemplate ([dev/event#58](https://lab.civicrm.org/dev/event/-/issues/58): [#20675](https://github.com/civicrm/civicrm-core/pull/20675))**
+* **_CiviMember_: Pass both variants "invoiceID"/"invoice_id" to payment-processor (for backward compatibility) ([#20689](https://github.com/civicrm/civicrm-core/pull/20689))**
+* **_Zeta Components/Mail_: Inbound mail procesing fails on certain email addresses ([dev/core#2604](https://lab.civicrm.org/dev/core/-/issues/2604): [#20661](https://github.com/civicrm/civicrm-core/pull/20661))**
+
+## <a name="credits"></a>Credits
+
+This release was developed by the following authors and reviewers:
+
+Wikimedia Foundation - Eileen McNaughton; SYSTOPIA Organisationsberatung - Björn Endres;
+oseidel; JMA Consulting - Seamus Lee; Dave D; CiviCRM - Tim Otten; Circle Interactive -
+Pradeep Nayak; Agileware - Justin Freeman, Francis Whittle
+
+## <a name="feedback"></a>Feedback
+
+These release notes are edited by Tim Otten and Andrew Hunt.  If you'd like to
+provide feedback on them, please login to https://chat.civicrm.org/civicrm and
+contact `@agh1`.
diff --git a/civicrm/sql/civicrm_data.mysql b/civicrm/sql/civicrm_data.mysql
index 4a0d37a2d692ec206c1a2073a6571506096417c3..dc7be682193cc4c7e8082c0e71e3c81829666f8e 100644
--- a/civicrm/sql/civicrm_data.mysql
+++ b/civicrm/sql/civicrm_data.mysql
@@ -23874,4 +23874,4 @@ INSERT INTO `civicrm_report_instance`
     ( `domain_id`, `title`, `report_id`, `description`, `permission`, `form_values`)
 VALUES
     (  @domainID, 'Survey Details', 'survey/detail', 'Detailed report for canvassing, phone-banking, walk lists or other surveys.', 'access CiviReport', 'a:39:{s:6:"fields";a:2:{s:9:"sort_name";s:1:"1";s:6:"result";s:1:"1";}s:22:"assignee_contact_id_op";s:2:"eq";s:25:"assignee_contact_id_value";s:0:"";s:12:"sort_name_op";s:3:"has";s:15:"sort_name_value";s:0:"";s:17:"street_number_min";s:0:"";s:17:"street_number_max";s:0:"";s:16:"street_number_op";s:3:"lte";s:19:"street_number_value";s:0:"";s:14:"street_name_op";s:3:"has";s:17:"street_name_value";s:0:"";s:15:"postal_code_min";s:0:"";s:15:"postal_code_max";s:0:"";s:14:"postal_code_op";s:3:"lte";s:17:"postal_code_value";s:0:"";s:7:"city_op";s:3:"has";s:10:"city_value";s:0:"";s:20:"state_province_id_op";s:2:"in";s:23:"state_province_id_value";a:0:{}s:13:"country_id_op";s:2:"in";s:16:"country_id_value";a:0:{}s:12:"survey_id_op";s:2:"in";s:15:"survey_id_value";a:0:{}s:12:"status_id_op";s:2:"eq";s:15:"status_id_value";s:1:"1";s:11:"custom_1_op";s:2:"in";s:14:"custom_1_value";a:0:{}s:11:"custom_2_op";s:2:"in";s:14:"custom_2_value";a:0:{}s:17:"custom_3_relative";s:1:"0";s:13:"custom_3_from";s:0:"";s:11:"custom_3_to";s:0:"";s:11:"description";s:75:"Detailed report for canvassing, phone-banking, walk lists or other surveys.";s:13:"email_subject";s:0:"";s:8:"email_to";s:0:"";s:8:"email_cc";s:0:"";s:10:"permission";s:17:"access CiviReport";s:6:"groups";s:0:"";s:9:"domain_id";i:1;}');
-UPDATE civicrm_domain SET version = '5.38.0';
+UPDATE civicrm_domain SET version = '5.38.1';
diff --git a/civicrm/sql/civicrm_generated.mysql b/civicrm/sql/civicrm_generated.mysql
index 494edcf94a0e1d1502cc7aa9569c9dc68ea08e14..757026dacd39e907ee5a32fa2313863093212aa5 100644
--- a/civicrm/sql/civicrm_generated.mysql
+++ b/civicrm/sql/civicrm_generated.mysql
@@ -399,7 +399,7 @@ UNLOCK TABLES;
 
 LOCK TABLES `civicrm_domain` WRITE;
 /*!40000 ALTER TABLE `civicrm_domain` DISABLE KEYS */;
-INSERT INTO `civicrm_domain` (`id`, `name`, `description`, `version`, `contact_id`, `locales`, `locale_custom_strings`) VALUES (1,'Default Domain Name',NULL,'5.38.0',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
+INSERT INTO `civicrm_domain` (`id`, `name`, `description`, `version`, `contact_id`, `locales`, `locale_custom_strings`) VALUES (1,'Default Domain Name',NULL,'5.38.1',1,NULL,'a:1:{s:5:\"en_US\";a:0:{}}');
 /*!40000 ALTER TABLE `civicrm_domain` ENABLE KEYS */;
 UNLOCK TABLES;
 
diff --git a/civicrm/vendor/autoload.php b/civicrm/vendor/autoload.php
index 916244c66044e5a8b5f452ba3b819e9b04de2dd6..0aa3d3835ad95d6f1a9c6dcf51e7a42a4c810078 100644
--- a/civicrm/vendor/autoload.php
+++ b/civicrm/vendor/autoload.php
@@ -4,4 +4,4 @@
 
 require_once __DIR__ . '/composer/autoload_real.php';
 
-return ComposerAutoloaderInit8732d10bd4cc90ac27565809da11fc04::getLoader();
+return ComposerAutoloaderInitd57997205be3721e32c907dd430b7abd::getLoader();
diff --git a/civicrm/vendor/composer/autoload_real.php b/civicrm/vendor/composer/autoload_real.php
index b8988d5ef389e6ce73b334b2f7c8173d2868009b..1aef4430ecb68145f4d4384966d4a487d7474427 100644
--- a/civicrm/vendor/composer/autoload_real.php
+++ b/civicrm/vendor/composer/autoload_real.php
@@ -2,7 +2,7 @@
 
 // autoload_real.php @generated by Composer
 
-class ComposerAutoloaderInit8732d10bd4cc90ac27565809da11fc04
+class ComposerAutoloaderInitd57997205be3721e32c907dd430b7abd
 {
     private static $loader;
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInit8732d10bd4cc90ac27565809da11fc04
             return self::$loader;
         }
 
-        spl_autoload_register(array('ComposerAutoloaderInit8732d10bd4cc90ac27565809da11fc04', 'loadClassLoader'), true, true);
+        spl_autoload_register(array('ComposerAutoloaderInitd57997205be3721e32c907dd430b7abd', 'loadClassLoader'), true, true);
         self::$loader = $loader = new \Composer\Autoload\ClassLoader();
-        spl_autoload_unregister(array('ComposerAutoloaderInit8732d10bd4cc90ac27565809da11fc04', 'loadClassLoader'));
+        spl_autoload_unregister(array('ComposerAutoloaderInitd57997205be3721e32c907dd430b7abd', 'loadClassLoader'));
 
         $includePaths = require __DIR__ . '/include_paths.php';
         $includePaths[] = get_include_path();
@@ -31,7 +31,7 @@ class ComposerAutoloaderInit8732d10bd4cc90ac27565809da11fc04
         if ($useStaticLoader) {
             require_once __DIR__ . '/autoload_static.php';
 
-            call_user_func(\Composer\Autoload\ComposerStaticInit8732d10bd4cc90ac27565809da11fc04::getInitializer($loader));
+            call_user_func(\Composer\Autoload\ComposerStaticInitd57997205be3721e32c907dd430b7abd::getInitializer($loader));
         } else {
             $map = require __DIR__ . '/autoload_namespaces.php';
             foreach ($map as $namespace => $path) {
@@ -52,19 +52,19 @@ class ComposerAutoloaderInit8732d10bd4cc90ac27565809da11fc04
         $loader->register(true);
 
         if ($useStaticLoader) {
-            $includeFiles = Composer\Autoload\ComposerStaticInit8732d10bd4cc90ac27565809da11fc04::$files;
+            $includeFiles = Composer\Autoload\ComposerStaticInitd57997205be3721e32c907dd430b7abd::$files;
         } else {
             $includeFiles = require __DIR__ . '/autoload_files.php';
         }
         foreach ($includeFiles as $fileIdentifier => $file) {
-            composerRequire8732d10bd4cc90ac27565809da11fc04($fileIdentifier, $file);
+            composerRequired57997205be3721e32c907dd430b7abd($fileIdentifier, $file);
         }
 
         return $loader;
     }
 }
 
-function composerRequire8732d10bd4cc90ac27565809da11fc04($fileIdentifier, $file)
+function composerRequired57997205be3721e32c907dd430b7abd($fileIdentifier, $file)
 {
     if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
         require $file;
diff --git a/civicrm/vendor/composer/autoload_static.php b/civicrm/vendor/composer/autoload_static.php
index 2ec260fc973d4e0456ef34329423f3e7091f9df3..f8cf1855c991182df745a7b9abbe28e345bf0f8d 100644
--- a/civicrm/vendor/composer/autoload_static.php
+++ b/civicrm/vendor/composer/autoload_static.php
@@ -4,7 +4,7 @@
 
 namespace Composer\Autoload;
 
-class ComposerStaticInit8732d10bd4cc90ac27565809da11fc04
+class ComposerStaticInitd57997205be3721e32c907dd430b7abd
 {
     public static $files = array (
         '320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
@@ -575,11 +575,11 @@ class ComposerStaticInit8732d10bd4cc90ac27565809da11fc04
     public static function getInitializer(ClassLoader $loader)
     {
         return \Closure::bind(function () use ($loader) {
-            $loader->prefixLengthsPsr4 = ComposerStaticInit8732d10bd4cc90ac27565809da11fc04::$prefixLengthsPsr4;
-            $loader->prefixDirsPsr4 = ComposerStaticInit8732d10bd4cc90ac27565809da11fc04::$prefixDirsPsr4;
-            $loader->prefixesPsr0 = ComposerStaticInit8732d10bd4cc90ac27565809da11fc04::$prefixesPsr0;
-            $loader->fallbackDirsPsr0 = ComposerStaticInit8732d10bd4cc90ac27565809da11fc04::$fallbackDirsPsr0;
-            $loader->classMap = ComposerStaticInit8732d10bd4cc90ac27565809da11fc04::$classMap;
+            $loader->prefixLengthsPsr4 = ComposerStaticInitd57997205be3721e32c907dd430b7abd::$prefixLengthsPsr4;
+            $loader->prefixDirsPsr4 = ComposerStaticInitd57997205be3721e32c907dd430b7abd::$prefixDirsPsr4;
+            $loader->prefixesPsr0 = ComposerStaticInitd57997205be3721e32c907dd430b7abd::$prefixesPsr0;
+            $loader->fallbackDirsPsr0 = ComposerStaticInitd57997205be3721e32c907dd430b7abd::$fallbackDirsPsr0;
+            $loader->classMap = ComposerStaticInitd57997205be3721e32c907dd430b7abd::$classMap;
 
         }, null, ClassLoader::class);
     }
diff --git a/civicrm/vendor/composer/installed.json b/civicrm/vendor/composer/installed.json
index 5e1d376a859c1195f7f6c912a8080afb040b83a6..ef83ab487f91bd136cc370791e1f5f41bcf39692 100644
--- a/civicrm/vendor/composer/installed.json
+++ b/civicrm/vendor/composer/installed.json
@@ -3936,7 +3936,8 @@
         "type": "library",
         "extra": {
             "patches_applied": {
-                "CiviCRM Custom Patches for ZetaCompoents mail": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch"
+                "CiviCRM Custom Patches for ZetaCompoents mail": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch",
+                "Allow single quotes to be used in return path": "https://github.com/zetacomponents/Mail/pull/86.patch"
             }
         },
         "installation-source": "dist",
@@ -3991,6 +3992,10 @@
             }
         ],
         "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"
+        "homepage": "https://github.com/zetacomponents",
+        "support": {
+            "issues": "https://github.com/zetacomponents/Mail/issues",
+            "source": "https://github.com/zetacomponents/Mail/tree/1.9.2"
+        }
     }
 ]
diff --git a/civicrm/vendor/zetacomponents/mail/PATCHES.txt b/civicrm/vendor/zetacomponents/mail/PATCHES.txt
index a5249ba8147f1f8c2e27eb62b7fe768c0ad1147c..f44ccbf59de179e986bacf30b28cc57e335a624c 100644
--- a/civicrm/vendor/zetacomponents/mail/PATCHES.txt
+++ b/civicrm/vendor/zetacomponents/mail/PATCHES.txt
@@ -5,3 +5,7 @@ CiviCRM Custom Patches for ZetaCompoents mail
 Source: https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch
 
 
+Allow single quotes to be used in return path
+Source: https://github.com/zetacomponents/Mail/pull/86.patch
+
+
diff --git a/civicrm/vendor/zetacomponents/mail/phpunit.xml.dist b/civicrm/vendor/zetacomponents/mail/phpunit.xml.dist
index 4ca087d8ffd86fceab72d0674657d7486105686e..311e6ad4a6203f1583defaeac66ffdda9850b25a 100644
--- a/civicrm/vendor/zetacomponents/mail/phpunit.xml.dist
+++ b/civicrm/vendor/zetacomponents/mail/phpunit.xml.dist
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<phpunit bootstrap="./tests/bootstrap.php" colors="true" beStrictAboutTestsThatDoNotTestAnything="false">
+<phpunit bootstrap="./tests/bootstrap.php" colors="true" beStrictAboutTestsThatDoNotTestAnything="false" cacheResult="false">
     <testsuites>
         <testsuite name="Zeta Components Mail">
             <directory suffix="_test.php">./tests</directory>
diff --git a/civicrm/vendor/zetacomponents/mail/src/mail.php b/civicrm/vendor/zetacomponents/mail/src/mail.php
index 24393fe8ef3bee55ab067023e24c65de0a49a25d..27daa8e065f2381876606b1da40a53115c38ebaa 100644
--- a/civicrm/vendor/zetacomponents/mail/src/mail.php
+++ b/civicrm/vendor/zetacomponents/mail/src/mail.php
@@ -133,7 +133,7 @@ class ezcMail extends ezcMailPart
     /**
      * Characters allowed in the returnPath address
      */
-    const RETURN_PATH_CHARS = 'A-Za-z0-9_.@=/+{}#~-';
+    const RETURN_PATH_CHARS = 'A-Za-z0-9_.@=/+{}#~\-\'';
 
     /**
      * Holds the options for this class.
diff --git a/civicrm/xml/version.xml b/civicrm/xml/version.xml
index e8a05ca964f79852f5b61ec434a60e7216aabedc..41168302fb9b1531611e6a0abb6e101e930915af 100644
--- a/civicrm/xml/version.xml
+++ b/civicrm/xml/version.xml
@@ -1,4 +1,4 @@
 <?xml version="1.0" encoding="iso-8859-1" ?>
 <version>
-  <version_no>5.38.0</version_no>
+  <version_no>5.38.1</version_no>
 </version>