Post SMTP Mailer/Email Log - Version 1.9.6

Version Description

  • 2019-01-29
  • Added support for our new chrome notification extension.
  • few fixes
Download this release

Release Info

Developer yehudah
Plugin Icon 128x128 Post SMTP Mailer/Email Log
Version 1.9.6
Comparing to
See all releases

Code changes from version 1.9.5 to 1.9.6

Postman/Postman-Configuration/PostmanConfigurationController.php CHANGED
@@ -428,6 +428,29 @@ class PostmanConfigurationController {
428
</table>
429
</div>
430
431
<?php
432
print '</fieldset>';
433
428
</table>
429
</div>
430
431
+ <div id="use-chrome-extension">
432
+ <h2><?php _e( 'Push To Chrome Extension', Postman::TEXT_DOMAIN ); ?></h2>
433
+ <table class="form-table">
434
+ <tbody>
435
+ <tr>
436
+ <th scope="row"><?php _e( 'This is an extra notification to the selection above', Postman::TEXT_DOMAIN ); ?></th>
437
+ <td>
438
+ <input type="checkbox" id="notification_use_chrome" name="postman_options[notification_use_chrome]">
439
+ <a target="_blank" class="" href="https://chrome.google.com/webstore/detail/npklmbkpbknkmbohdbpikeidiaekjoch">
440
+ <?php _e( 'You can download the chrome extensiom here.', Postman::TEXT_DOMAIN ); ?>
441
+ </a>
442
+ </td>
443
+ </tr>
444
+ <tr>
445
+ <th scope="row"><?php _e( 'Your UID as you see in the extension.', Postman::TEXT_DOMAIN ); ?></th>
446
+ <td>
447
+ <input type="password" id="notification_chrome_uid" name="postman_options[notification_chrome_uid]" value="">
448
+ </td>
449
+ </tr>
450
+ </tbody>
451
+ </table>
452
+ </div>
453
+
454
<?php
455
print '</fieldset>';
456
Postman/Postman-Configuration/PostmanRegisterConfigurationSettings.php CHANGED
@@ -213,6 +213,16 @@ class PostmanSettingsRegistry {
213
'slack_token_callback',
214
), PostmanAdminController::NOTIFICATIONS_SLACK_CRED, 'slack_credentials' );
215
216
}
217
}
218
@@ -415,6 +425,15 @@ class PostmanSettingsRegistry {
415
printf( '</select><br/><span class="postman_input_description">%s</span>', $inputDescription );
416
}
417
418
public function pushover_user_callback() {
419
printf( '<input type="password" id="pushover_user" name="%s[%s]" value="%s" />', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::PUSHOVER_USER, $this->options->getPushoverUser() );
420
}
213
'slack_token_callback',
214
), PostmanAdminController::NOTIFICATIONS_SLACK_CRED, 'slack_credentials' );
215
216
+ add_settings_field( PostmanOptions::NOTIFICATION_USE_CHROME, _x( 'Push to chrome extension', 'Configuration Input Field', Postman::TEXT_DOMAIN ), array(
217
+ $this,
218
+ 'notification_use_chrome_callback',
219
+ ), PostmanAdminController::NOTIFICATIONS_OPTIONS, PostmanAdminController::NOTIFICATIONS_SECTION );
220
+
221
+ add_settings_field( PostmanOptions::NOTIFICATION_CHROME_UID, _x( 'Chrome Extension UID', 'Configuration Input Field', Postman::TEXT_DOMAIN ), array(
222
+ $this,
223
+ 'notification_chrome_uid_callback',
224
+ ), PostmanAdminController::NOTIFICATIONS_OPTIONS, PostmanAdminController::NOTIFICATIONS_SECTION );
225
+
226
}
227
}
228
425
printf( '</select><br/><span class="postman_input_description">%s</span>', $inputDescription );
426
}
427
428
+ public function notification_use_chrome_callback() {
429
+ $value = $this->options->useChromeExtension();
430
+ printf( '<input type="checkbox" id="input_%2$s" class="input_%2$s" name="%1$s[%2$s]" %3$s />', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::NOTIFICATION_USE_CHROME, $value ? 'checked="checked"' : '' );
431
+ }
432
+
433
+ public function notification_chrome_uid_callback() {
434
+ printf( '<input type="password" id="input_%2$s" class="input_%2$s" name="%1$s[%2$s]" value="%3$s" />', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::NOTIFICATION_CHROME_UID, $this->options->getNotificationChromeUid() );
435
+ }
436
+
437
public function pushover_user_callback() {
438
printf( '<input type="password" id="pushover_user" name="%s[%s]" value="%s" />', PostmanOptions::POSTMAN_OPTIONS, PostmanOptions::PUSHOVER_USER, $this->options->getPushoverUser() );
439
}
Postman/Postman-Diagnostic-Test/PostmanDiagnosticTestController.php CHANGED
@@ -208,8 +208,11 @@ class PostmanGetDiagnosticsViaAjax {
208
/**
209
*/
210
public function getDiagnostics() {
211
$transportRegistry = PostmanTransportRegistry::getInstance();
212
$this->addToDiagnostics( 'HostName', PostmanUtils::getServerName() );
213
$this->addToDiagnostics( 'OS', php_uname() );
214
$this->addToDiagnostics( 'PHP', PHP_OS . ' ' . PHP_VERSION . ' ' . setlocale( LC_CTYPE, 0 ) );
215
$this->addToDiagnostics( 'PHP Dependencies', $this->getPhpDependencies() );
208
/**
209
*/
210
public function getDiagnostics() {
211
+ $curl = curl_version();
212
$transportRegistry = PostmanTransportRegistry::getInstance();
213
$this->addToDiagnostics( 'HostName', PostmanUtils::getServerName() );
214
+ $this->addToDiagnostics( 'cURL Version', $curl['version'] );
215
+ $this->addToDiagnostics( 'OpenSSL Version', $curl['ssl_version'] );
216
$this->addToDiagnostics( 'OS', php_uname() );
217
$this->addToDiagnostics( 'PHP', PHP_OS . ' ' . PHP_VERSION . ' ' . setlocale( LC_CTYPE, 0 ) );
218
$this->addToDiagnostics( 'PHP Dependencies', $this->getPhpDependencies() );
Postman/Postman-Email-Log/PostmanEmailLogService.php CHANGED
@@ -182,6 +182,7 @@ if ( ! class_exists( 'PostmanEmailLogService' ) ) {
182
183
$notify = new PostmanNotify( $notifyer, $message );
184
$notify->send($message, $log);
185
}
186
187
/**
182
183
$notify = new PostmanNotify( $notifyer, $message );
184
$notify->send($message, $log);
185
+ $notify->push_to_chrome($log->statusMessage);
186
}
187
188
/**
Postman/Postman-Mail/PostmanMailgunMailEngine.php CHANGED
@@ -224,7 +224,7 @@ if ( ! class_exists( 'PostmanMailgunMailEngine' ) ) {
224
225
private function addHeader( $name, $value, $deprecated = '' ) {
226
if ( $value && ! empty( $value ) ) {
227
- $this->mailgunMessage['h:' . $name] = $value;
228
}
229
}
230
224
225
private function addHeader( $name, $value, $deprecated = '' ) {
226
if ( $value && ! empty( $value ) ) {
227
+ $this->mailgunMessage['h:' . $name] = preg_replace('/.*:\s?/', '', $value);
228
}
229
}
230
Postman/Postman-Mail/Zend-1.12.10/Mail/Protocol/Smtp.php CHANGED
@@ -210,7 +210,19 @@ class Postman_Zend_Mail_Protocol_Smtp extends Postman_Zend_Mail_Protocol_Abstrac
210
211
$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
212
213
- if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
214
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
215
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
216
}
210
211
$crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
212
213
+ $curl = curl_version();
214
+ preg_match('/.*\/(\d*\.\d*\.\d*)[a-z]?/', $curl['ssl_version'], $ver_match );
215
+ $tlsv1_2_installed = ! empty( $ver_match[1] ) ? $ver_match[1] >= '1.0.1' : true;
216
+
217
+ if ( $this->_host == 'smtp.office365.com' && ! $tlsv1_2_installed ) {
218
+
219
+ $error = sprintf( 'Office365 SMTP servie require TLS v1.2 and OpenSSL version 1.0.1 or greater, your current OpenSSL version is: %s.
220
+ You need to contact your web hosting support for help.', $ver_match[1] );
221
+
222
+ throw new Postman_Zend_Mail_Protocol_Exception( $error );
223
+ }
224
+
225
+ if ( defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT') ) {
226
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
227
$crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
228
}
Postman/PostmanInputSanitizer.php CHANGED
@@ -74,6 +74,9 @@ if ( ! class_exists( 'PostmanInputSanitizer' ) ) {
74
$this->sanitizePassword( 'Pushover Token', PostmanOptions::PUSHOVER_TOKEN, $input, $new_input, $this->options->getPushoverToken() );
75
$this->sanitizePassword( 'Slack Token', PostmanOptions::SLACK_TOKEN, $input, $new_input, $this->options->getSlackToken() );
76
77
if ( $new_input [ PostmanOptions::CLIENT_ID ] != $this->options->getClientId() || $new_input [ PostmanOptions::CLIENT_SECRET ] != $this->options->getClientSecret() || $new_input [ PostmanOptions::HOSTNAME ] != $this->options->getHostname() ) {
78
$this->logger->debug( 'Recognized new Client ID' );
79
// the user entered a new client id and we should destroy the stored auth token
74
$this->sanitizePassword( 'Pushover Token', PostmanOptions::PUSHOVER_TOKEN, $input, $new_input, $this->options->getPushoverToken() );
75
$this->sanitizePassword( 'Slack Token', PostmanOptions::SLACK_TOKEN, $input, $new_input, $this->options->getSlackToken() );
76
77
+ $this->sanitizeString( 'Push Chrome Extension', PostmanOptions::NOTIFICATION_USE_CHROME, $input, $new_input );
78
+ $this->sanitizePassword( 'Push Chrome Extension UID', PostmanOptions::NOTIFICATION_CHROME_UID, $input, $new_input, $this->options->getNotificationChromeUid() );
79
+
80
if ( $new_input [ PostmanOptions::CLIENT_ID ] != $this->options->getClientId() || $new_input [ PostmanOptions::CLIENT_SECRET ] != $this->options->getClientSecret() || $new_input [ PostmanOptions::HOSTNAME ] != $this->options->getHostname() ) {
81
$this->logger->debug( 'Recognized new Client ID' );
82
// the user entered a new client id and we should destroy the stored auth token
Postman/PostmanOptions.php CHANGED
@@ -106,6 +106,8 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
106
const TEMPORARY_DIRECTORY = 'tmp_dir';
107
const DISABLE_EMAIL_VALIDAITON = 'disable_email_validation';
108
const NOTIFICATION_SERVICE = 'notification_service';
109
const PUSHOVER_USER = 'pushover_user';
110
const PUSHOVER_TOKEN = 'pushover_token';
111
const SLACK_TOKEN = 'slack_token';
@@ -341,6 +343,18 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
341
return base64_decode( $this->options [ PostmanOptions::SLACK_TOKEN ] );
342
}
343
}
344
345
public function getReplyTo() {
346
if ( isset( $this->options [ PostmanOptions::REPLY_TO ] ) ) {
106
const TEMPORARY_DIRECTORY = 'tmp_dir';
107
const DISABLE_EMAIL_VALIDAITON = 'disable_email_validation';
108
const NOTIFICATION_SERVICE = 'notification_service';
109
+ const NOTIFICATION_USE_CHROME = 'notification_use_chrome';
110
+ const NOTIFICATION_CHROME_UID = 'notification_chrome_uid';
111
const PUSHOVER_USER = 'pushover_user';
112
const PUSHOVER_TOKEN = 'pushover_token';
113
const SLACK_TOKEN = 'slack_token';
343
return base64_decode( $this->options [ PostmanOptions::SLACK_TOKEN ] );
344
}
345
}
346
+
347
+ public function useChromeExtension() {
348
+ if ( isset( $this->options [ PostmanOptions::NOTIFICATION_USE_CHROME ] ) ) {
349
+ return $this->options [ PostmanOptions::NOTIFICATION_USE_CHROME ];
350
+ }
351
+ }
352
+
353
+ public function getNotificationChromeUid() {
354
+ if ( isset( $this->options [ PostmanOptions::NOTIFICATION_CHROME_UID ] ) ) {
355
+ return base64_decode( $this->options [ PostmanOptions::NOTIFICATION_CHROME_UID ] );
356
+ }
357
+ }
358
359
public function getReplyTo() {
360
if ( isset( $this->options [ PostmanOptions::REPLY_TO ] ) ) {
Postman/PostmanUtils.php CHANGED
@@ -445,37 +445,21 @@ class PostmanUtils {
445
$result = 'localhost.localdomain';
446
447
if (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER)) {
448
- $result = $_SERVER['SERVER_NAME'];
449
} elseif (function_exists('gethostname') and gethostname() !== false) {
450
- $result = gethostname();
451
} elseif (php_uname('n') !== false) {
452
- $result = php_uname('n');
453
}
454
455
- if ( $result !== 'localhost.localdomain' ) {
456
- // get the current result ip
457
- $ip = gethostbyname($result);
458
-
459
- // dns query failed
460
- if ( $ip == $result ) {
461
- return $result;
462
- }
463
-
464
- // get the current ip hostname - reverse dns
465
- $host = gethostbyaddr($ip);
466
-
467
- // dns query failed
468
- if ( $host == $ip ) {
469
- return $result;
470
- }
471
-
472
- // if hostname is not equal to the result set the ptr
473
- if ( $result !== $host ) {
474
- $result = $host;
475
- }
476
- }
477
478
- return $result;
479
}
480
481
public static function getHost( $url ) {
445
$result = 'localhost.localdomain';
446
447
if (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER)) {
448
+ $host = $_SERVER['SERVER_NAME'];
449
} elseif (function_exists('gethostname') and gethostname() !== false) {
450
+ $host = gethostname();
451
} elseif (php_uname('n') !== false) {
452
+ $host = php_uname('n');
453
}
454
455
+ // as final option - if ip returned or hostname without extension (not valid dns name)
456
+ $extension = pathinfo( $host, PATHINFO_EXTENSION );
457
+ if ( filter_var( $result, FILTER_VALIDATE_IP ) || empty( $extension ) ) {
458
+ $siteurl = get_bloginfo('url');
459
+ $host = parse_url($siteurl, PHP_URL_HOST);
460
+ }
461
462
+ return str_replace('www.', '', $host );
463
}
464
465
public static function getHost( $url ) {
Postman/PostmanViewController.php CHANGED
@@ -307,7 +307,7 @@ if ( ! class_exists( 'PostmanViewController' ) ) {
307
echo '
308
<div class="updated settings-error notice is-dismissible">
309
<p>
310
- <strong>Version ' . $version . ' Mailgun Europe region support:</strong> <a target="_blank" href="https://postmansmtp.com/post-smtp-1-9-5-mailgun-europe-region-support/">Read Here</a>
311
</p>
312
<button style="z-index: 100;" data-version="'. $version . '" data-security="' . wp_create_nonce('postsmtp') .'" type="button" class="notice-dismiss postman-release-message">
313
<span class="screen-reader-text">Dismiss this notice.</span>
307
echo '
308
<div class="updated settings-error notice is-dismissible">
309
<p>
310
+ <strong>Version ' . $version . ' We have a new Chrome Extension:</strong> <a target="_blank" href="https://postmansmtp.com/post-smtp-1-9-6-new-chrome-extension/">Read Here</a>
311
</p>
312
<button style="z-index: 100;" data-version="'. $version . '" data-security="' . wp_create_nonce('postsmtp') .'" type="button" class="notice-dismiss postman-release-message">
313
<span class="screen-reader-text">Dismiss this notice.</span>
Postman/notifications/PostmanMailNotify.php CHANGED
@@ -4,7 +4,7 @@ class PostmanMailNotify implements Postman_Notify {
4
5
public function send_message($message)
6
{
7
- $to_email = get_bloginfo( 'admin_email' );
8
$domain = get_bloginfo( 'url' );
9
10
mail( $to_email, "{$domain}: " . __( 'Post SMTP email error', Postman::TEXT_DOMAIN ), $message , '', "-f{$to_email}" );
4
5
public function send_message($message)
6
{
7
+ $to_email = apply_filters( 'post_smtp_notify_email',get_bloginfo( 'admin_email' ) );
8
$domain = get_bloginfo( 'url' );
9
10
mail( $to_email, "{$domain}: " . __( 'Post SMTP email error', Postman::TEXT_DOMAIN ), $message , '', "-f{$to_email}" );
Postman/notifications/PostmanNotify.php CHANGED
@@ -14,4 +14,26 @@ class PostmanNotify {
14
public function send( $message, $log ) {
15
$this->notify->send_message( $message );
16
}
17
}
14
public function send( $message, $log ) {
15
$this->notify->send_message( $message );
16
}
17
+
18
+ public function push_to_chrome($message) {
19
+ $push_chrome = PostmanOptions::getInstance()->useChromeExtension();
20
+
21
+ if ( $push_chrome ) {
22
+ $uid = PostmanOptions::getInstance()->getNotificationChromeUid();
23
+
24
+ if ( empty( $uid ) ) {
25
+ return;
26
+ }
27
+
28
+ $url = 'https://postmansmtp.com/chrome/' . $uid;
29
+
30
+ $args = array(
31
+ 'body' => array(
32
+ 'message' => $message
33
+ )
34
+ );
35
+
36
+ $response = wp_remote_post( $url , $args );
37
+ }
38
+ }
39
}
postman-smtp.php CHANGED
@@ -3,7 +3,7 @@
3
* Plugin Name: Post SMTP
4
* Plugin URI: https://wordpress.org/plugins/post-smtp/
5
* Description: Email not reliable? Post SMTP is the first and only WordPress SMTP plugin to implement OAuth 2.0 for Gmail, Hotmail and Yahoo Mail. Setup is a breeze with the Configuration Wizard and integrated Port Tester. Enjoy worry-free delivery even if your password changes!
6
- * Version: 1.9.5
7
* Author: Jason Hendriks, Yehuda Hassine
8
* Text Domain: post-smtp
9
* Author URI: https://postmansmtp.com
@@ -122,5 +122,5 @@ function post_start( $startingMemory ) {
122
*/
123
function post_setupPostman() {
124
require_once 'Postman/Postman.php';
125
- $kevinCostner = new Postman( __FILE__, '1.9.5' );
126
}
3
* Plugin Name: Post SMTP
4
* Plugin URI: https://wordpress.org/plugins/post-smtp/
5
* Description: Email not reliable? Post SMTP is the first and only WordPress SMTP plugin to implement OAuth 2.0 for Gmail, Hotmail and Yahoo Mail. Setup is a breeze with the Configuration Wizard and integrated Port Tester. Enjoy worry-free delivery even if your password changes!
6
+ * Version: 1.9.6
7
* Author: Jason Hendriks, Yehuda Hassine
8
* Text Domain: post-smtp
9
* Author URI: https://postmansmtp.com
122
*/
123
function post_setupPostman() {
124
require_once 'Postman/Postman.php';
125
+ $kevinCostner = new Postman( __FILE__, '1.9.6' );
126
}
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: yehudah ,jasonhendriks
3
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yehuda@myinbox.in&item_name=Donation+for+PostSMTP
4
Tags: postman smtp, postman, smtp, email, mail, mailer, email log, oauth2, gmail, google apps, hotmail, yahoo, mandrill api, sendgrid api, elastic email, office365, mailgun
5
Requires at least: 3.9
6
- Tested up to: 4.9.9
7
- Stable tag: 1.9.5
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -12,13 +12,16 @@ Send, log and troubleshoot your Outgoing Email easily. Supports everything: SMTP
12
13
== Description ==
14
15
- = Version 1.9.5 released - Mailgun Europe region support =
16
- Small updates but important to read. [Read the detailes here](https://postmansmtp.com/post-smtp-1-9-5-mailgun-europe-region-support/)
17
18
= WordPress Mail SMTP Plugin =
19
20
= Postman SMTP is back! =
21
- Now under new maintenance, no need to search for another SMTP plugin anymore.
22
23
Post SMTP is a next-generation WP Mail SMTP plugin, that assists in the delivery of email generated by your WordPress site. Post SMTP is the first and only plugin to support the [latest security standards](http://googleonlinesecurity.blogspot.ca/2014/04/new-security-measures-will-affect-older.html). With OAuth 2.0, there is **no need** to [store your email passsword](http://blog.codinghorror.com/youre-probably-storing-passwords-incorrectly/) in the WordPress database where it might be found.
24
@@ -285,6 +288,11 @@ To avoid being flagged as spam, you need to prove your email isn't forged. On a
285
286
287
== Changelog ==
288
= 1.9.5 - 2018-10-02
289
* Added support for Mailgun Europe region.
290
* Replace "buggey" mime_content_type php function
3
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yehuda@myinbox.in&item_name=Donation+for+PostSMTP
4
Tags: postman smtp, postman, smtp, email, mail, mailer, email log, oauth2, gmail, google apps, hotmail, yahoo, mandrill api, sendgrid api, elastic email, office365, mailgun
5
Requires at least: 3.9
6
+ Tested up to: 5.0.3
7
+ Stable tag: 1.9.6
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
12
13
== Description ==
14
15
+ = Version 1.9.6 released - We have a new Chrome extension =
16
+ New Chrome extension and small updates. [Read the detailes here](https://postmansmtp.com/post-smtp-1-9-6-new-chrome-extension/)
17
+
18
+ = The Only SMTP plugin with chrome Notifications =
19
+ Get notified if your emails are failing inside your Chrome browser. [Download here](https://chrome.google.com/webstore/detail/post-smtp-notifications/npklmbkpbknkmbohdbpikeidiaekjoch?hl=en-US)
20
21
= WordPress Mail SMTP Plugin =
22
23
= Postman SMTP is back! =
24
+ No need to search for another SMTP plugin anymore.
25
26
Post SMTP is a next-generation WP Mail SMTP plugin, that assists in the delivery of email generated by your WordPress site. Post SMTP is the first and only plugin to support the [latest security standards](http://googleonlinesecurity.blogspot.ca/2014/04/new-security-measures-will-affect-older.html). With OAuth 2.0, there is **no need** to [store your email passsword](http://blog.codinghorror.com/youre-probably-storing-passwords-incorrectly/) in the WordPress database where it might be found.
27
288
289
290
== Changelog ==
291
+
292
+ = 1.9.6 - 2019-01-29
293
+ * Added support for our new chrome notification extension.
294
+ * few fixes
295
+
296
= 1.9.5 - 2018-10-02
297
* Added support for Mailgun Europe region.
298
* Replace "buggey" mime_content_type php function