summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-09-26 07:29:28 +0000
committeryehudah <yehudah@b8457f37-d9ea-0310-8a92-e5e31aec5664>2019-09-26 07:29:28 +0000
commit9b04db8503c2cf4501bf88d588e2b901916c7490 (patch)
treeefbee82944e1a297a474edecb406e084e154cedd
parentcaa73945f9fe69875171ea2aade2c53e60b21bbe (diff)
downloadPost-SMTP-9b04db8503c2cf4501bf88d588e2b901916c7490.zip
2.0.5 released - Few notifications errors, export logs and minor improvements
-rw-r--r--Postman/Postman-Connectivity-Test/registered-domain-libs-master/.gitignore3
-rw-r--r--Postman/Postman-Mail/google-api-client/vendor/google/apiclient-services/.gitignore4
-rw-r--r--Postman/Postman-Mail/google-api-client/vendor/google/auth/.gitignore3
-rw-r--r--Postman/Postman-Mail/google-api-client/vendor/psr/log/.gitignore1
-rw-r--r--Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/.gitignore2
-rw-r--r--Postman/Postman-Mail/mailgun/vendor/symfony/options-resolver/.gitignore3
-rw-r--r--Postman/Postman-Mail/mailgun/vendor/webmozart/assert/.gitignore2
-rw-r--r--Postman/Postman-Mail/sendgrid/.gitignore7
-rw-r--r--Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/.gitignore11
-rw-r--r--Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/.gitignore19
-rw-r--r--Postman/PostmanLogFields.php62
-rw-r--r--Postman/PostmanViewController.php4
-rw-r--r--postman-smtp.php7
-rw-r--r--readme.txt9
14 files changed, 64 insertions, 73 deletions
diff --git a/Postman/Postman-Connectivity-Test/registered-domain-libs-master/.gitignore b/Postman/Postman-Connectivity-Test/registered-domain-libs-master/.gitignore
deleted file mode 100644
index 7886a27..0000000
--- a/Postman/Postman-Connectivity-Test/registered-domain-libs-master/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-C/*.o
-C/libregdom.so.1
-C/test-regdom
diff --git a/Postman/Postman-Mail/google-api-client/vendor/google/apiclient-services/.gitignore b/Postman/Postman-Mail/google-api-client/vendor/google/apiclient-services/.gitignore
deleted file mode 100644
index 01150f6..0000000
--- a/Postman/Postman-Mail/google-api-client/vendor/google/apiclient-services/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-vendor
-composer.lock
-src/Google/Service/Compute/HTTPHealthCheck.php
-src/Google/Service/Compute/HTTPSHealthCheck.php
diff --git a/Postman/Postman-Mail/google-api-client/vendor/google/auth/.gitignore b/Postman/Postman-Mail/google-api-client/vendor/google/auth/.gitignore
deleted file mode 100644
index 1cb030a..0000000
--- a/Postman/Postman-Mail/google-api-client/vendor/google/auth/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-*~
-vendor
-composer.lock
diff --git a/Postman/Postman-Mail/google-api-client/vendor/psr/log/.gitignore b/Postman/Postman-Mail/google-api-client/vendor/psr/log/.gitignore
deleted file mode 100644
index 22d0d82..0000000
--- a/Postman/Postman-Mail/google-api-client/vendor/psr/log/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-vendor
diff --git a/Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/.gitignore b/Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/.gitignore
deleted file mode 100644
index de4a392..0000000
--- a/Postman/Postman-Mail/mailgun/vendor/clue/stream-filter/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/vendor
-/composer.lock
diff --git a/Postman/Postman-Mail/mailgun/vendor/symfony/options-resolver/.gitignore b/Postman/Postman-Mail/mailgun/vendor/symfony/options-resolver/.gitignore
deleted file mode 100644
index c49a5d8..0000000
--- a/Postman/Postman-Mail/mailgun/vendor/symfony/options-resolver/.gitignore
+++ /dev/null
@@ -1,3 +0,0 @@
-vendor/
-composer.lock
-phpunit.xml
diff --git a/Postman/Postman-Mail/mailgun/vendor/webmozart/assert/.gitignore b/Postman/Postman-Mail/mailgun/vendor/webmozart/assert/.gitignore
deleted file mode 100644
index 3a9875b..0000000
--- a/Postman/Postman-Mail/mailgun/vendor/webmozart/assert/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-/vendor/
-composer.lock
diff --git a/Postman/Postman-Mail/sendgrid/.gitignore b/Postman/Postman-Mail/sendgrid/.gitignore
deleted file mode 100644
index 6df0272..0000000
--- a/Postman/Postman-Mail/sendgrid/.gitignore
+++ /dev/null
@@ -1,7 +0,0 @@
-test/coverage/*
-examples/*
-dist/
-composer.lock
-vendor
-.env*
-sendgrid-php.php
diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/.gitignore b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/.gitignore
deleted file mode 100644
index b90ffc5..0000000
--- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/php-http-client/.gitignore
+++ /dev/null
@@ -1,11 +0,0 @@
-# Composer
-vendor/
-*.phar
-*.lock
-
-# Jetbrains Idea
-*.old
-.idea/
-
-# Environment files
-.env/*.* \ No newline at end of file
diff --git a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/.gitignore b/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/.gitignore
deleted file mode 100644
index efe514c..0000000
--- a/Postman/Postman-Mail/sendgrid/vendor/sendgrid/sendgrid/.gitignore
+++ /dev/null
@@ -1,19 +0,0 @@
-test/coverage/*
-dist/
-composer.lock
-vendor
-.env
-sendgrid.env
-composer.phar
-.editorconfig
-test.php
-.idea/
-test/prism_linux_amd64
-test/prism/*
-!test/prim
-*.code-workspace
-.vscode
-prism*
-temp.php
-example*.php
-TODO.txt
diff --git a/Postman/PostmanLogFields.php b/Postman/PostmanLogFields.php
index 6e04b8d..04d24a4 100644
--- a/Postman/PostmanLogFields.php
+++ b/Postman/PostmanLogFields.php
@@ -3,17 +3,17 @@ class PostmanLogFields {
private $fields = array(
'success' => 'sanitize_text_field',
- 'from_header' => '',
- 'to_header' => '',
- 'cc_header' => '',
- 'bcc_header' => '',
- 'reply_to_header' => '',
+ 'from_header' => [ 'PostmanLogFields', 'email_header_sanitize' ],
+ 'to_header' => [ 'PostmanLogFields', 'email_header_sanitize' ],
+ 'cc_header' => [ 'PostmanLogFields', 'email_header_sanitize' ],
+ 'bcc_header' => [ 'PostmanLogFields', 'email_header_sanitize' ],
+ 'reply_to_header' => [ 'PostmanLogFields', 'email_header_sanitize' ],
'transport_uri' => 'sanitize_text_field',
'original_to' => 'sanitize_text_field',
'original_subject' => 'sanitize_text_field',
- 'original_message' => null,
- 'original_headers' => 'sanitize_text_field',
- 'session_transcript' => 'sanitize_textarea_field',
+ 'original_message' => '', // only sent to viewed
+ 'original_headers' => '', // only sent to viewed
+ 'session_transcript' => '', // escaped when viewed
);
private static $instance = null;
@@ -28,7 +28,7 @@ class PostmanLogFields {
private function __construct()
{
- $this->fields['original_message'] = array( $this, 'sanitize_message' );
+
}
public function get( $post_id ) {
@@ -73,13 +73,14 @@ class PostmanLogFields {
}
private function sanitize( $key, $value ) {
+
$callback = is_array( $value ) ? 'array_map' : 'call_user_func';
if ( ! empty( $this->fields[$key] ) ) {
return $callback( $this->fields[$key], $value );
}
- return filter_var( $value, FILTER_SANITIZE_STRING | FILTER_SANITIZE_SPECIAL_CHARS );
+ return $value;
}
private function sanitize_message( $message ) {
@@ -96,4 +97,43 @@ class PostmanLogFields {
return $value;
}
-} \ No newline at end of file
+
+ public function get_string_between($string, $start, $end){
+ $string = ' ' . $string;
+ $ini = strpos($string, $start);
+
+ if ($ini == 0) {
+ return '';
+ }
+
+ $ini += strlen($start);
+ $len = strpos($string, $end, $ini) - $ini;
+
+ return substr($string, $ini, $len);
+ }
+
+ public function email_header_sanitize($value) {
+
+ $parts = explode( ',', $value );
+
+ $sanitized = [];
+ foreach ( $parts as $part ) {
+
+ if ( strpos( $part, '<' ) !== false ) {
+ $email = $this->get_string_between( $part, '<', '>' );
+ $clean_email = $this->sanitize_email($email);
+ preg_match('/(.*)</', $part, $output_array);
+ $name = filter_var( trim( $output_array[1] ), FILTER_SANITIZE_STRING );
+
+ $sanitized[] = "{$name} <{$clean_email}>";
+ }
+ }
+
+ return ! empty( $sanitized ) ? implode( ',', $sanitized ) : implode( ',', array_map( [ $this, 'sanitize_email'], $parts ) );
+ }
+
+ public function sanitize_email( $email ) {
+ return filter_var( $email, FILTER_SANITIZE_EMAIL );
+ }
+}
+
diff --git a/Postman/PostmanViewController.php b/Postman/PostmanViewController.php
index 050033f..dfd4207 100644
--- a/Postman/PostmanViewController.php
+++ b/Postman/PostmanViewController.php
@@ -319,11 +319,11 @@ if ( ! class_exists( 'PostmanViewController' ) ) {
$show = get_option('postman_release_version' );
printf( '<h2>%s</h2>', sprintf( __( '%s Setup', 'post-smtp' ), __( 'Post SMTP', 'post-smtp' ) ) );
- if ( ! $show ) {
+ if ( ! $show && POST_SMTP_SHOW_RELEASE_MESSAGE ) {
echo '
<div class="updated settings-error notice is-dismissible">
<p>
- <strong>Version ' . $version . ' Sendgrid code fix and default delivery changes:</strong> <a target="_blank" href="https://postmansmtp.com/post-smtp-2-0-2-sendgrid-code-revert/">Read Here</a>
+ <strong>Version ' . $version . ' ' . POST_SMTP_RELEASE_MESSAGE . ':</strong> <a target="_blank" href="' . POST_SMTP_RELEASE_URL . '">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>
diff --git a/postman-smtp.php b/postman-smtp.php
index 80dc8da..cafd928 100644
--- a/postman-smtp.php
+++ b/postman-smtp.php
@@ -6,7 +6,7 @@ if ( ! defined( 'ABSPATH' ) ) {
* Plugin Name: Post SMTP
* Plugin URI: https://wordpress.org/plugins/post-smtp/
* 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!
- * Version: 2.0.4
+ * Version: 2.0.5
* Author: Yehuda Hassine
* Text Domain: post-smtp
* Author URI: https://postmansmtp.com
@@ -44,7 +44,10 @@ if ( ! defined( 'ABSPATH' ) ) {
define( 'POST_SMTP_BASE', __FILE__ );
define( 'POST_SMTP_PATH', __DIR__ );
define( 'POST_SMTP_URL', plugins_url('', POST_SMTP_BASE ) );
-define( 'POST_SMTP_VER', '2.0.4' );
+define( 'POST_SMTP_VER', '2.0.5' );
+define( 'POST_SMTP_SHOW_RELEASE_MESSAGE', false );
+define( 'POST_SMTP_RELEASE_MESSAGE', false );
+define( 'POST_SMTP_RELEASE_URL', '#' );
$postman_smtp_exist = in_array( 'postman-smtp/postman-smtp.php', (array) get_option( 'active_plugins', array() ) );
$required_php_version = version_compare( PHP_VERSION, '5.6.0', '<' );
diff --git a/readme.txt b/readme.txt
index 9781cb4..1b780c2 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yehuda@m
Tags: postman smtp, postman, smtp, email, mail, mailer, email log, oauth2, gmail, google apps, hotmail, yahoo, mandrill api, sendgrid api, elastic email, office365, mailgun
Requires at least: 3.9
Tested up to: 5.2.2
-Stable tag: 2.0.4
+Stable tag: 2.0.5
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -12,8 +12,7 @@ Send, log and troubleshoot your Outgoing Email easily. Supports everything: SMTP
== Description ==
-= Version 2.0.4 released - The plugin is more secure =
-Final fixes to make it the best and secure mailer plugin for WordPress
+= Version 2.0.5 released - Few notifications errors, export logs and minor improvements =
= The Only SMTP plugin with chrome Notifications =
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)
@@ -289,6 +288,10 @@ To avoid being flagged as spam, you need to prove your email isn't forged. On a
== Changelog ==
+= 2.0.5 - 2019-09-26
+* New: You can now export logs to CSV.
+* Updated: Few notifications errors, and minor improvements.
+
= 2.0.4 - 2019-08-27
* Updated: More security.