Postie - Version 1.8.42

Version Description

(2017-05-10) = * Wrap all attachments in div with css class "postie-attachments" * Remove APOP authentication attempt as some servers disconnect on failure.

Download this release

Release Info

Developer WayneAllen
Plugin Icon 128x128 Postie
Version 1.8.42
Comparing to
See all releases

Code changes from version 1.8.41 to 1.8.42

docs/Changes.txt CHANGED
@@ -35,6 +35,10 @@ All script, style and body tags are stripped from html emails.
35
  Attachments are now processed in the order they were attached.
36
 
37
  == CHANGELOG ==
 
 
 
 
38
  = 1.8.41 (2017-05-05) =
39
  * Organizational changes in prep for move to more OO approach
40
  * Fix error when time offset is negative.
35
  Attachments are now processed in the order they were attached.
36
 
37
  == CHANGELOG ==
38
+ = 1.8.42 (2017-05-10) =
39
+ * Wrap all attachments in div with css class "postie-attachments"
40
+ * Remove APOP authentication attempt as some servers disconnect on failure.
41
+
42
  = 1.8.41 (2017-05-05) =
43
  * Organizational changes in prep for move to more OO approach
44
  * Fix error when time offset is negative.
docs/Postie.txt CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.7.4
9
- Stable tag: 1.8.41
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.7.4
9
+ Stable tag: 1.8.42
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
lib/pSocketConnection.php CHANGED
@@ -44,6 +44,7 @@ class pSocketConnection extends pConnection {
44
  stream_set_timeout($this->socket, $this->timeout);
45
 
46
  if ($this->type == 'imap') {
 
47
  if ($this->secure && extension_loaded('openssl')) {
48
  $response = $this->write('CAPABILITY');
49
  if (preg_match('#\bstarttls\b#i', $response[0])) {
@@ -62,6 +63,7 @@ class pSocketConnection extends pConnection {
62
  }
63
  $this->write('SELECT "' . $this->mailbox . '"');
64
  } elseif ($this->type == 'pop3') {
 
65
  $response = $this->read(1);
66
  if (isset($response[0])) {
67
  if ($response[0][0] == '-') {
@@ -71,6 +73,7 @@ class pSocketConnection extends pConnection {
71
  }
72
 
73
  if ($this->secure && extension_loaded('openssl')) {
 
74
  $response = $this->write('STLS', 1);
75
  if ($response[0][0] == '+') {
76
  $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
@@ -92,12 +95,13 @@ class pSocketConnection extends pConnection {
92
  }
93
 
94
  $authenticated = FALSE;
95
- if (isset($match[0])) {
96
- $response = $this->write('APOP ' . $this->username . ' ' . md5($match[0] . $this->password), 1);
97
- if (isset($response[0]) && $response[0][0] == '+') {
98
- $authenticated = TRUE;
99
- }
100
- }
 
101
 
102
  if (!$authenticated) {
103
  $response = $this->write('USER ' . $this->username, 1);
@@ -129,7 +133,7 @@ class pSocketConnection extends pConnection {
129
  if ((strpos($command, ' LOGIN') === false) & (strpos($command, 'APOP ') === false ) & (strpos($command, 'PASS ') === false )) {
130
  DebugEcho("socket write: " . trim($command));
131
  } else {
132
- DebugEcho("socket write: (login)");
133
  }
134
 
135
  $res = fwrite($this->socket, $command);
@@ -217,9 +221,7 @@ class pSocketConnection extends pConnection {
217
  }
218
  }
219
  }
220
- // if (fCore::getDebug($this->debug)) {
221
- // fCore::debug("Received:\n" . join("\r\n", $response), $this->debug);
222
- // }
223
  DebugEcho("socket read (" . count($response) . ') :' . $response[0]);
224
  //DebugDump($response);
225
 
44
  stream_set_timeout($this->socket, $this->timeout);
45
 
46
  if ($this->type == 'imap') {
47
+ DebugEcho("Socket: IMAP");
48
  if ($this->secure && extension_loaded('openssl')) {
49
  $response = $this->write('CAPABILITY');
50
  if (preg_match('#\bstarttls\b#i', $response[0])) {
63
  }
64
  $this->write('SELECT "' . $this->mailbox . '"');
65
  } elseif ($this->type == 'pop3') {
66
+ DebugEcho("Socket: POP3");
67
  $response = $this->read(1);
68
  if (isset($response[0])) {
69
  if ($response[0][0] == '-') {
73
  }
74
 
75
  if ($this->secure && extension_loaded('openssl')) {
76
+ DebugEcho("Socket: attempting a secure connection");
77
  $response = $this->write('STLS', 1);
78
  if ($response[0][0] == '+') {
79
  $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
95
  }
96
 
97
  $authenticated = FALSE;
98
+ // commented out since some mail servers disconnect if APOP is not supported
99
+ // if (isset($match[0])) {
100
+ // $response = $this->write('APOP ' . $this->username . ' ' . md5($match[0] . $this->password), 1);
101
+ // if (isset($response[0]) && $response[0][0] == '+') {
102
+ // $authenticated = TRUE;
103
+ // }
104
+ // }
105
 
106
  if (!$authenticated) {
107
  $response = $this->write('USER ' . $this->username, 1);
133
  if ((strpos($command, ' LOGIN') === false) & (strpos($command, 'APOP ') === false ) & (strpos($command, 'PASS ') === false )) {
134
  DebugEcho("socket write: " . trim($command));
135
  } else {
136
+ DebugEcho("socket write: (login) LOGIN/APOP/PASS");
137
  }
138
 
139
  $res = fwrite($this->socket, $command);
221
  }
222
  }
223
  }
224
+ //fCore::debug("Received:\n" . join("\r\n", $response), true);
 
 
225
  DebugEcho("socket read (" . count($response) . ') :' . $response[0]);
226
  //DebugDump($response);
227
 
postie-functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- $Id: postie-functions.php 1651745 2017-05-05 17:58:24Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
@@ -303,9 +303,9 @@ function filter_AttachmentTemplates($content, $mimeDecodedEmail, $post_id, $conf
303
  }
304
 
305
  if ($config['images_append']) {
306
- $content .= $html;
307
  } else {
308
- $content = $html . $content;
309
  }
310
 
311
 
1
  <?php
2
  /*
3
+ $Id: postie-functions.php 1653903 2017-05-09 22:46:20Z WayneAllen $
4
  */
5
 
6
  class PostiePostModifiers {
303
  }
304
 
305
  if ($config['images_append']) {
306
+ $content = '<div class="postie-attachments">' . $content . '</div>' . $html;
307
  } else {
308
+ $content = $html . '<div class="postie-attachments">' . $content . '</div>';
309
  }
310
 
311
 
postie.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Significantly upgrades the Post by Email features of WordPress.
7
- Version: 1.8.41
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
@@ -28,7 +28,7 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1651747 2017-05-05 18:12:39Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fException.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fUnexpectedException.php");
@@ -55,13 +55,14 @@ require_once(ABSPATH . 'wp-admin/includes/file.php');
55
  require_once(ABSPATH . 'wp-admin/includes/image.php');
56
  require_once(ABSPATH . 'wp-admin/includes/media.php');
57
  require_once(ABSPATH . 'wp-admin/includes/file.php'); //wp_tempnam()
 
58
  require_once( ABSPATH . WPINC . '/class-oembed.php' );
59
 
60
  if (!function_exists('file_get_html')) {
61
  require_once (plugin_dir_path(__FILE__) . 'lib/simple_html_dom.php');
62
  }
63
 
64
- define('POSTIE_VERSION', '1.8.41');
65
  define("POSTIE_ROOT", dirname(__FILE__));
66
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
67
 
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Create posts via email. Significantly upgrades the Post by Email features of WordPress.
7
+ Version: 1.8.42
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1654655 2017-05-10 21:43:19Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fException.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fUnexpectedException.php");
55
  require_once(ABSPATH . 'wp-admin/includes/image.php');
56
  require_once(ABSPATH . 'wp-admin/includes/media.php');
57
  require_once(ABSPATH . 'wp-admin/includes/file.php'); //wp_tempnam()
58
+
59
  require_once( ABSPATH . WPINC . '/class-oembed.php' );
60
 
61
  if (!function_exists('file_get_html')) {
62
  require_once (plugin_dir_path(__FILE__) . 'lib/simple_html_dom.php');
63
  }
64
 
65
+ define('POSTIE_VERSION', '1.8.42');
66
  define("POSTIE_ROOT", dirname(__FILE__));
67
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
68
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://PostiePlugin.com/
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.7.4
9
- Stable tag: 1.8.41
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -242,6 +242,10 @@ All script, style and body tags are stripped from html emails.
242
  Attachments are now processed in the order they were attached.
243
 
244
  == CHANGELOG ==
 
 
 
 
245
  = 1.8.41 (2017-05-05) =
246
  * Organizational changes in prep for move to more OO approach
247
  * Fix error when time offset is negative.
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.7.4
9
+ Stable tag: 1.8.42
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
242
  Attachments are now processed in the order they were attached.
243
 
244
  == CHANGELOG ==
245
+ = 1.8.42 (2017-05-10) =
246
+ * Wrap all attachments in div with css class "postie-attachments"
247
+ * Remove APOP authentication attempt as some servers disconnect on failure.
248
+
249
  = 1.8.41 (2017-05-05) =
250
  * Organizational changes in prep for move to more OO approach
251
  * Fix error when time offset is negative.