summaryrefslogtreecommitdiff
path: root/Postman
diff options
context:
space:
mode:
Diffstat (limited to 'Postman')
-rw-r--r--Postman/Postman-Mail/Zend-1.12.10/Mail/Protocol/Smtp.php9
-rw-r--r--Postman/PostmanOptions.php34
-rw-r--r--Postman/PostmanViewController.php2
3 files changed, 39 insertions, 6 deletions
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 b71ff10..be6d908 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
@@ -208,7 +208,14 @@ class Postman_Zend_Mail_Protocol_Smtp extends Postman_Zend_Mail_Protocol_Abstrac
stream_context_set_option($this->_socket, 'ssl', 'verify_peer_name', false);
stream_context_set_option($this->_socket, 'ssl', 'allow_self_signed', true);
- if (!stream_socket_enable_crypto($this->_socket, true, STREAM_CRYPTO_METHOD_TLS_CLIENT)) {
+ $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
+
+ if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
+ $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
+ $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
+ }
+
+ if (!stream_socket_enable_crypto($this->_socket, true, $crypto_method)) {
/**
* @see Postman_Zend_Mail_Protocol_Exception
*/
diff --git a/Postman/PostmanOptions.php b/Postman/PostmanOptions.php
index 193f8c9..20d3a04 100644
--- a/Postman/PostmanOptions.php
+++ b/Postman/PostmanOptions.php
@@ -260,16 +260,42 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
return $this->options [ PostmanOptions::AUTHENTICATION_TYPE ]; }
}
public function getEncryptionType() {
- if ( isset( $this->options [ PostmanOptions::SECURITY_TYPE ] ) ) {
- return $this->options [ PostmanOptions::SECURITY_TYPE ]; }
+ $port = $this->getPort();
+ switch ($port):
+ case 25:
+ return 'none';
+ break;
+ case 465:
+ return 'ssl';
+ break;
+ case 587:
+ return 'tls';
+ break;
+ case 2525:
+ return 'tls';
+ break;
+ default:
+ return isset( $this->options [ PostmanOptions::SECURITY_TYPE ] ) ? $this->options [ PostmanOptions::SECURITY_TYPE ] : 'none';
+ endswitch;
}
public function getUsername() {
+ if ( defined( POST_SMTP_AUTH_USERNAME ) ) {
+ return POST_SMTP_AUTH_USERNAME;
+ }
+
if ( isset( $this->options [ PostmanOptions::BASIC_AUTH_USERNAME ] ) ) {
- return $this->options [ PostmanOptions::BASIC_AUTH_USERNAME ]; }
+ return $this->options [ PostmanOptions::BASIC_AUTH_USERNAME ];
+ }
}
public function getPassword() {
+
+ if ( defined( POST_SMTP_AUTH_PASSWORD ) ) {
+ return POST_SMTP_AUTH_PASSWORD;
+ }
+
if ( isset( $this->options [ PostmanOptions::BASIC_AUTH_PASSWORD ] ) ) {
- return base64_decode( $this->options [ PostmanOptions::BASIC_AUTH_PASSWORD ] ); }
+ return base64_decode( $this->options [ PostmanOptions::BASIC_AUTH_PASSWORD ] );
+ }
}
public function getMandrillApiKey() {
if ( isset( $this->options [ PostmanOptions::MANDRILL_API_KEY ] ) ) {
diff --git a/Postman/PostmanViewController.php b/Postman/PostmanViewController.php
index 5fb8cb1..7aeeae4 100644
--- a/Postman/PostmanViewController.php
+++ b/Postman/PostmanViewController.php
@@ -307,7 +307,7 @@ if ( ! class_exists( 'PostmanViewController' ) ) {
echo '
<div class="updated settings-error notice is-dismissible">
<p>
- <strong>Version ' . $version . ' released with lockfile fix and new PHP requirement:</strong> <a target="_blank" href="https://postmansmtp.com/post-smtp-v1-8-6-lockfile-and-raise-the-php-version">Read Here</a>
+ <strong>Version ' . $version . ' released with better compability for secure ports:</strong> <a target="_blank" href="https://postmansmtp.com/post-smtp-1-9-0-better-support-for-secure-delivery">Read Here</a>
</p>
<button style="z-index: 100;" data-version="'. $version . '" data-security="' . wp_create_nonce('postsmtp') .'" type="button" class="notice-dismiss postman-release-message">
<span class="screen-reader-text">Dismiss this notice.</span>