Post SMTP Mailer/Email Log - Version 1.9.8

Version Description

  • 2019-02-18
  • New: a new from field to the fallback - Can't trust the username as "from" value (email address).
Download this release

Release Info

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

Code changes from version 1.9.7 to 1.9.8

Postman/Postman-Configuration/PostmanConfigurationController.php CHANGED
@@ -301,6 +301,18 @@ class PostmanConfigurationController {
301
  </td>
302
  </tr>
303
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  <tr valign="">
305
  <th scope="row"><?php _e( 'Use SMTP Authentication?', Postman::TEXT_DOMAIN ); ?></th>
306
  <td>
301
  </td>
302
  </tr>
303
 
304
+ <tr>
305
+ <th scope="row"><?php _e('From Email', Postman::TEXT_DOMAIN ); ?></th>
306
+ <td>
307
+ <input type="email" id="fallback-smtp-from-email"
308
+ value="<?php echo $this->options->getFallbackFromEmail(); ?>"
309
+ name="postman_options[<?php echo PostmanOptions::FALLBACK_FROM_EMAIL; ?>]"
310
+ >
311
+ <br>
312
+ <small><?php _e( "Use allowed email, for example: If you are using Gmail, type your Gmail adress.", Postman::TEXT_DOMAIN ); ?></small>
313
+ </td>
314
+ </tr>
315
+
316
  <tr valign="">
317
  <th scope="row"><?php _e( 'Use SMTP Authentication?', Postman::TEXT_DOMAIN ); ?></th>
318
  <td>
Postman/Postman-Mail/PostmanMessage.php CHANGED
@@ -228,6 +228,13 @@ if ( ! class_exists( 'PostmanMessage' ) ) {
228
  $this->logger->debug( sprintf( 'Forced From email address: before=%s after=%s', $this->getFromAddress()->getEmail(), $forcedEmailAddress ) );
229
  $this->getFromAddress()->setEmail( $forcedEmailAddress );
230
  }
 
 
 
 
 
 
 
231
  $forcedEmailName = $options->getMessageSenderName();
232
  if ( $options->isSenderNameOverridePrevented() && $this->getFromAddress()->getName() !== $forcedEmailName ) {
233
  $this->logger->debug( sprintf( 'Forced From email name: before=%s after=%s', $this->getFromAddress()->getName(), $forcedEmailName ) );
228
  $this->logger->debug( sprintf( 'Forced From email address: before=%s after=%s', $this->getFromAddress()->getEmail(), $forcedEmailAddress ) );
229
  $this->getFromAddress()->setEmail( $forcedEmailAddress );
230
  }
231
+
232
+ if ( $options->is_fallback ) {
233
+ $fallback_email = $options->getFallbackFromEmail();
234
+ $this->logger->debug( sprintf( 'Fallback: Forced From email address: before=%s after=%s', $this->getFromAddress()->getEmail(), $fallback_email ) );
235
+ $this->getFromAddress()->setEmail( $fallback_email );
236
+ }
237
+
238
  $forcedEmailName = $options->getMessageSenderName();
239
  if ( $options->isSenderNameOverridePrevented() && $this->getFromAddress()->getName() !== $forcedEmailName ) {
240
  $this->logger->debug( sprintf( 'Forced From email name: before=%s after=%s', $this->getFromAddress()->getName(), $forcedEmailName ) );
Postman/PostmanInputSanitizer.php CHANGED
@@ -85,6 +85,7 @@ if ( ! class_exists( 'PostmanInputSanitizer' ) ) {
85
  $this->sanitizeInt( 'Fallback port', PostmanOptions::FALLBACK_SMTP_PORT, $input, $new_input );
86
  $this->sanitizeString( 'Fallback security', PostmanOptions::FALLBACK_SMTP_SECURITY, $input, $new_input );
87
  $this->sanitizeString( 'Fallback auth', PostmanOptions::FALLBACK_SMTP_USE_AUTH, $input, $new_input );
 
88
  $this->sanitizeString( 'Fallback username', PostmanOptions::FALLBACK_SMTP_USERNAME, $input, $new_input );
89
  $this->sanitizePassword( 'Fallback password', PostmanOptions::FALLBACK_SMTP_PASSWORD, $input, $new_input, $this->options->getFallbackPassword() );
90
 
85
  $this->sanitizeInt( 'Fallback port', PostmanOptions::FALLBACK_SMTP_PORT, $input, $new_input );
86
  $this->sanitizeString( 'Fallback security', PostmanOptions::FALLBACK_SMTP_SECURITY, $input, $new_input );
87
  $this->sanitizeString( 'Fallback auth', PostmanOptions::FALLBACK_SMTP_USE_AUTH, $input, $new_input );
88
+ $this->sanitizeString( 'Fallback username', PostmanOptions::FALLBACK_FROM_EMAIL, $input, $new_input );
89
  $this->sanitizeString( 'Fallback username', PostmanOptions::FALLBACK_SMTP_USERNAME, $input, $new_input );
90
  $this->sanitizePassword( 'Fallback password', PostmanOptions::FALLBACK_SMTP_PASSWORD, $input, $new_input, $this->options->getFallbackPassword() );
91
 
Postman/PostmanOptions.php CHANGED
@@ -118,6 +118,7 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
118
  const FALLBACK_SMTP_HOSTNAME = 'fallback_smtp_hostname';
119
  const FALLBACK_SMTP_PORT = 'fallback_smtp_port';
120
  const FALLBACK_SMTP_SECURITY = 'fallback_smtp_security';
 
121
  const FALLBACK_SMTP_USE_AUTH = 'fallback_smtp_use_auth';
122
  const FALLBACK_SMTP_USERNAME = 'fallback_smtp_username';
123
  const FALLBACK_SMTP_PASSWORD = 'fallback_smtp_password';
@@ -286,7 +287,7 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
286
  public function getEnvelopeSender() {
287
 
288
  if ( $this->is_fallback ) {
289
- return $this->getFallbackUsername();
290
  }
291
 
292
  if ( isset( $this->options [ PostmanOptions::ENVELOPE_SENDER ] ) ) {
@@ -296,12 +297,18 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
296
  public function getMessageSenderEmail() {
297
 
298
  if ( $this->is_fallback ) {
299
- return $this->getFallbackUsername();
300
  }
301
 
302
  if ( isset( $this->options [ PostmanOptions::MESSAGE_SENDER_EMAIL ] ) ) {
303
  return $this->options [ PostmanOptions::MESSAGE_SENDER_EMAIL ]; }
304
  }
 
 
 
 
 
 
305
  public function getMessageSenderName() {
306
  if ( isset( $this->options [ PostmanOptions::MESSAGE_SENDER_NAME ] ) ) {
307
  return $this->options [ PostmanOptions::MESSAGE_SENDER_NAME ]; }
@@ -534,10 +541,6 @@ if ( ! class_exists( 'PostmanOptions' ) ) {
534
  return $this->isPluginSenderEmailEnforced();
535
  }
536
  public function isPluginSenderEmailEnforced() {
537
-
538
- if ( $this->is_fallback ) {
539
- return true;
540
- }
541
 
542
  if ( $this->isNew() ) {
543
  return self::DEFAULT_PLUGIN_MESSAGE_SENDER_EMAIL_ENFORCED; }
118
  const FALLBACK_SMTP_HOSTNAME = 'fallback_smtp_hostname';
119
  const FALLBACK_SMTP_PORT = 'fallback_smtp_port';
120
  const FALLBACK_SMTP_SECURITY = 'fallback_smtp_security';
121
+ const FALLBACK_FROM_EMAIL = 'fallback_from_email';
122
  const FALLBACK_SMTP_USE_AUTH = 'fallback_smtp_use_auth';
123
  const FALLBACK_SMTP_USERNAME = 'fallback_smtp_username';
124
  const FALLBACK_SMTP_PASSWORD = 'fallback_smtp_password';
287
  public function getEnvelopeSender() {
288
 
289
  if ( $this->is_fallback ) {
290
+ return $this->getFallbackFromEmail();
291
  }
292
 
293
  if ( isset( $this->options [ PostmanOptions::ENVELOPE_SENDER ] ) ) {
297
  public function getMessageSenderEmail() {
298
 
299
  if ( $this->is_fallback ) {
300
+ return $this->getFallbackFromEmail();
301
  }
302
 
303
  if ( isset( $this->options [ PostmanOptions::MESSAGE_SENDER_EMAIL ] ) ) {
304
  return $this->options [ PostmanOptions::MESSAGE_SENDER_EMAIL ]; }
305
  }
306
+
307
+ public function getFallbackFromEmail() {
308
+ if ( isset( $this->options [ PostmanOptions::FALLBACK_FROM_EMAIL ] ) ) {
309
+ return $this->options [ PostmanOptions::FALLBACK_FROM_EMAIL ]; }
310
+ }
311
+
312
  public function getMessageSenderName() {
313
  if ( isset( $this->options [ PostmanOptions::MESSAGE_SENDER_NAME ] ) ) {
314
  return $this->options [ PostmanOptions::MESSAGE_SENDER_NAME ]; }
541
  return $this->isPluginSenderEmailEnforced();
542
  }
543
  public function isPluginSenderEmailEnforced() {
 
 
 
 
544
 
545
  if ( $this->isNew() ) {
546
  return self::DEFAULT_PLUGIN_MESSAGE_SENDER_EMAIL_ENFORCED; }
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.7
7
  * Author: Yehuda Hassine
8
  * Text Domain: post-smtp
9
  * Author URI: https://postmansmtp.com
@@ -126,5 +126,5 @@ function post_start( $startingMemory ) {
126
  */
127
  function post_setupPostman() {
128
  require_once 'Postman/Postman.php';
129
- $kevinCostner = new Postman( __FILE__, '1.9.7' );
130
  }
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.8
7
  * Author: Yehuda Hassine
8
  * Text Domain: post-smtp
9
  * Author URI: https://postmansmtp.com
126
  */
127
  function post_setupPostman() {
128
  require_once 'Postman/Postman.php';
129
+ $kevinCostner = new Postman( __FILE__, '1.9.8' );
130
  }
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=yehuda@m
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.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -12,7 +12,7 @@ Send, log and troubleshoot your Outgoing Email easily. Supports everything: SMTP
12
 
13
  == Description ==
14
 
15
- = Version 1.9.7 released - The SMTP Fallback =
16
  A fallback is a unique solution only exist on Post SMTP.
17
  You can configure a backup SMTP, so if your emails are failing your site will keep sending emails !!! [Read the detailes here](https://postmansmtp.com/post-smtp-1-9-7-the-smtp-fallback/)
18
 
@@ -290,6 +290,9 @@ To avoid being flagged as spam, you need to prove your email isn't forged. On a
290
 
291
  == Changelog ==
292
 
 
 
 
293
  = 1.9.7 - 2019-02-17
294
  * New: Fallback Feature - Configure a backup SMTP when emails are failing.
295
  * New: WordPress Multisite compability - with global settings.
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.8
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.8 released - The SMTP Fallback =
16
  A fallback is a unique solution only exist on Post SMTP.
17
  You can configure a backup SMTP, so if your emails are failing your site will keep sending emails !!! [Read the detailes here](https://postmansmtp.com/post-smtp-1-9-7-the-smtp-fallback/)
18
 
290
 
291
  == Changelog ==
292
 
293
+ = 1.9.8 - 2019-02-18
294
+ * New: a new from field to the fallback - Can't trust the username as "from" value (email address).
295
+
296
  = 1.9.7 - 2019-02-17
297
  * New: Fallback Feature - Configure a backup SMTP when emails are failing.
298
  * New: WordPress Multisite compability - with global settings.