diff options
author | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2018-11-29 11:33:11 +0000 |
---|---|---|
committer | yehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664> | 2018-11-29 11:33:11 +0000 |
commit | 4c2738e179c4d994b6b6db3c67d9d1c227a0ede1 (patch) | |
tree | 5fcee9e6188885d4d813aa0f6ae5714991843c63 /Postman/Postman-Mail | |
parent | d4f1be44c403a191b250eba13798f18a1c0daed9 (diff) | |
download | Post-SMTP-4c2738e179c4d994b6b6db3c67d9d1c227a0ede1.zip |
Diagnostic info + office 365 tls check + mailgun header issue
Diffstat (limited to 'Postman/Postman-Mail')
-rw-r--r-- | Postman/Postman-Mail/PostmanMailgunMailEngine.php | 2 | ||||
-rw-r--r-- | Postman/Postman-Mail/Zend-1.12.10/Mail/Protocol/Smtp.php | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/Postman/Postman-Mail/PostmanMailgunMailEngine.php b/Postman/Postman-Mail/PostmanMailgunMailEngine.php index e874704..f098ec9 100644 --- a/Postman/Postman-Mail/PostmanMailgunMailEngine.php +++ b/Postman/Postman-Mail/PostmanMailgunMailEngine.php @@ -224,7 +224,7 @@ if ( ! class_exists( 'PostmanMailgunMailEngine' ) ) { private function addHeader( $name, $value, $deprecated = '' ) { if ( $value && ! empty( $value ) ) { - $this->mailgunMessage['h:' . $name] = $value; + $this->mailgunMessage['h:' . $name] = preg_replace('/.*:\s?/', '', $value); } } diff --git a/Postman/Postman-Mail/Zend-1.12.10/Mail/Protocol/Smtp.php b/Postman/Postman-Mail/Zend-1.12.10/Mail/Protocol/Smtp.php index be6d908..6f3c978 100644 --- a/Postman/Postman-Mail/Zend-1.12.10/Mail/Protocol/Smtp.php +++ b/Postman/Postman-Mail/Zend-1.12.10/Mail/Protocol/Smtp.php @@ -210,7 +210,19 @@ class Postman_Zend_Mail_Protocol_Smtp extends Postman_Zend_Mail_Protocol_Abstrac $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT; - if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { + $curl = curl_version(); + preg_match('/.*\/(\d*\.\d*\.\d*)[a-z]?/', $curl['ssl_version'], $ver_match ); + $tlsv1_2_installed = ! empty( $ver_match[1] ) ? $ver_match[1] >= '1.0.1' : true; + + if ( $this->_host == 'smtp.office365.com' && ! $tlsv1_2_installed ) { + + $error = sprintf( 'Office365 SMTP servie require TLS v1.2 and OpenSSL version 1.0.1 or greater, your current OpenSSL version is: %s. +You need to contact your web hosting support for help.', $ver_match[1] ); + + throw new Postman_Zend_Mail_Protocol_Exception( $error ); + } + + if ( defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT') ) { $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; } |