Postie - Version 1.8.11

Version Description

(2016-10-24) = * Support Dovecot IMAP server better

Download this release

Release Info

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

Code changes from version 1.8.10 to 1.8.11

docs/Changes.txt CHANGED
@@ -32,6 +32,9 @@ All script, style and body tags are stripped from html emails.
32
  Attachments are now processed in the order they were attached.
33
 
34
  == CHANGELOG ==
 
 
 
35
  = 1.8.10 (2016-10-24) =
36
  * New filter postie_place_media - allows markup to be changed when #img# references are being replaced.
37
  * New filter postie_place_media_before - allows markup to be changed when attachment templates are placed before the content.
32
  Attachments are now processed in the order they were attached.
33
 
34
  == CHANGELOG ==
35
+ = 1.8.11 (2016-10-24) =
36
+ * Support Dovecot IMAP server better
37
+
38
  = 1.8.10 (2016-10-24) =
39
  * New filter postie_place_media - allows markup to be changed when #img# references are being replaced.
40
  * New filter postie_place_media_before - allows markup to be changed when attachment templates are placed before the content.
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.6.1
9
- Stable tag: 1.8.10
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.6.1
9
+ Stable tag: 1.8.11
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
lib/pImapMailServer.php CHANGED
@@ -139,9 +139,14 @@ class pImapMailServer extends pMailServer {
139
  }
140
 
141
  $output = array();
142
- $response = $this->connection->write('FETCH ' . $start . ':' . $end . ' (UID INTERNALDATE RFC822.SIZE ENVELOPE)');
 
 
143
  foreach ($response as $line) {
144
- if (preg_match('#^\s*\*\s+(\d+)\s+FETCH\s+\((.*)\)\s*$#', $line, $match)) {
 
 
 
145
  $details = self::parseResponse($match[2], TRUE);
146
  $info = array();
147
 
@@ -149,29 +154,30 @@ class pImapMailServer extends pMailServer {
149
  $info['received'] = $this->cleanDate($details['internaldate']);
150
  $info['size'] = $details['rfc822.size'];
151
 
152
- $envelope = $details['envelope'];
153
- $info['date'] = $envelope[0] != 'NIL' ? $envelope[0] : '';
154
- $info['from'] = $this->joinEmails($envelope[2]);
155
- if (preg_match('#=\?[^\?]+\?[QB]\?[^\?]+\?=#', $envelope[1])) {
156
- do {
157
- $last_subject = $envelope[1];
158
- $envelope[1] = preg_replace('#(=\?([^\?]+)\?[QB]\?[^\?]+\?=) (\s*=\?\2)#', '\1\3', $envelope[1]);
159
- } while ($envelope[1] != $last_subject);
160
- $info['subject'] = $this->decodeHeader($envelope[1]);
161
- } else {
162
- $info['subject'] = $envelope[1] == 'NIL' ? '' : $this->decodeHeader($envelope[1]);
163
- }
164
- if ($envelope[9] != 'NIL') {
165
- $info['message_id'] = $envelope[9];
166
- }
167
- if ($envelope[5] != 'NIL') {
168
- $info['to'] = $this->joinEmails($envelope[5]);
169
- }
170
- if ($envelope[8] != 'NIL') {
171
- $info['in_reply_to'] = $envelope[8];
172
- }
173
 
174
  $output[$info['uid']] = $info;
 
175
  }
176
  }
177
  return $output;
139
  }
140
 
141
  $output = array();
142
+ $mline = '';
143
+ //$response = $this->connection->write('FETCH ' . $start . ':' . $end . ' (UID INTERNALDATE RFC822.SIZE ENVELOPE)');
144
+ $response = $this->connection->write('FETCH ' . $start . ':' . $end . ' (UID INTERNALDATE RFC822.SIZE)');
145
  foreach ($response as $line) {
146
+ DebugEcho("listMessages: line: '$line'");
147
+ $mline = $line;
148
+ if (preg_match('#^\s*\*\s+(\d+)\s+FETCH\s+\((.*)\)\s*$#', $mline, $match)) {
149
+ DebugEcho("listMessages: found: $match[2]");
150
  $details = self::parseResponse($match[2], TRUE);
151
  $info = array();
152
 
154
  $info['received'] = $this->cleanDate($details['internaldate']);
155
  $info['size'] = $details['rfc822.size'];
156
 
157
+ // $envelope = $details['envelope'];
158
+ // $info['date'] = $envelope[0] != 'NIL' ? $envelope[0] : '';
159
+ // $info['from'] = $this->joinEmails($envelope[2]);
160
+ // if (preg_match('#=\?[^\?]+\?[QB]\?[^\?]+\?=#', $envelope[1])) {
161
+ // do {
162
+ // $last_subject = $envelope[1];
163
+ // $envelope[1] = preg_replace('#(=\?([^\?]+)\?[QB]\?[^\?]+\?=) (\s*=\?\2)#', '\1\3', $envelope[1]);
164
+ // } while ($envelope[1] != $last_subject);
165
+ // $info['subject'] = $this->decodeHeader($envelope[1]);
166
+ // } else {
167
+ // $info['subject'] = $envelope[1] == 'NIL' ? '' : $this->decodeHeader($envelope[1]);
168
+ // }
169
+ // if ($envelope[9] != 'NIL') {
170
+ // $info['message_id'] = $envelope[9];
171
+ // }
172
+ // if ($envelope[5] != 'NIL') {
173
+ // $info['to'] = $this->joinEmails($envelope[5]);
174
+ // }
175
+ // if ($envelope[8] != 'NIL') {
176
+ // $info['in_reply_to'] = $envelope[8];
177
+ // }
178
 
179
  $output[$info['uid']] = $info;
180
+ $mline = '';
181
  }
182
  }
183
  return $output;
lib/pSocketConnection.php CHANGED
@@ -128,9 +128,13 @@ class pSocketConnection extends pConnection {
128
  $command .= "\r\n";
129
  }
130
 
131
- DebugEcho("socket write: $command");
132
 
133
  $res = fwrite($this->socket, $command);
 
 
 
 
134
 
135
  if ($res === FALSE || $res === 0) {
136
  DebugEcho("Socket: error");
128
  $command .= "\r\n";
129
  }
130
 
131
+ DebugEcho("socket write: '$command'");
132
 
133
  $res = fwrite($this->socket, $command);
134
+ if ($res == 1) {
135
+ sleep(3);
136
+ $res = fwrite($this->socket, $command);
137
+ }
138
 
139
  if ($res === FALSE || $res === 0) {
140
  DebugEcho("Socket: error");
lib_autolink.php CHANGED
@@ -61,7 +61,7 @@ class PostieAutolink {
61
  $last_bit = array_pop($bits);
62
  if (preg_match("!<a\s!i", $last_bit)) {
63
 
64
- DebugEcho("autolink_do: fail 1 at $cursor");
65
 
66
  $ok = 0;
67
  $cursor += $fail_len;
@@ -96,7 +96,7 @@ class PostieAutolink {
96
  if ($pre) {
97
  if (!preg_match('![\s\(\[\{><]$!s', $pre)) {
98
 
99
- DebugEcho("autolink_do: fail 2 at $cursor ($pre)");
100
 
101
  $ok = 0;
102
  $cursor += $fail_len;
@@ -196,7 +196,7 @@ class PostieAutolink {
196
  $buffer .= "<a href=\"{$link_url_enc}\"$currentTagfill>{$display_url_enc}</a>";
197
  }
198
  } else {
199
- DebugEcho("autolink_do: fail 3 at $cursor");
200
 
201
  $ok = 0;
202
  $cursor += $fail_len;
61
  $last_bit = array_pop($bits);
62
  if (preg_match("!<a\s!i", $last_bit)) {
63
 
64
+ //DebugEcho("autolink_do: fail 1 at $cursor");
65
 
66
  $ok = 0;
67
  $cursor += $fail_len;
96
  if ($pre) {
97
  if (!preg_match('![\s\(\[\{><]$!s', $pre)) {
98
 
99
+ //DebugEcho("autolink_do: fail 2 at $cursor ($pre)");
100
 
101
  $ok = 0;
102
  $cursor += $fail_len;
196
  $buffer .= "<a href=\"{$link_url_enc}\"$currentTagfill>{$display_url_enc}</a>";
197
  }
198
  } else {
199
+ //DebugEcho("autolink_do: fail 3 at $cursor");
200
 
201
  $ok = 0;
202
  $cursor += $fail_len;
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.10
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
@@ -28,7 +28,7 @@
28
  */
29
 
30
  /*
31
- $Id: postie.php 1521269 2016-10-24 17:30:03Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fException.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fUnexpectedException.php");
@@ -49,7 +49,7 @@ require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/pPop3MailServer.php"
49
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
50
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
51
 
52
- define('POSTIE_VERSION', '1.8.10');
53
  define("POSTIE_ROOT", dirname(__FILE__));
54
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
55
 
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.11
8
  Author: Wayne Allen
9
  Author URI: http://PostiePlugin.com/
10
  License: GPL2
28
  */
29
 
30
  /*
31
+ $Id: postie.php 1521551 2016-10-25 03:35:04Z WayneAllen $
32
  */
33
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fException.php");
34
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib/fUnexpectedException.php");
49
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
50
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
51
 
52
+ define('POSTIE_VERSION', '1.8.11');
53
  define("POSTIE_ROOT", dirname(__FILE__));
54
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
55
 
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.6.1
9
- Stable tag: 1.8.10
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
@@ -240,6 +240,9 @@ All script, style and body tags are stripped from html emails.
240
  Attachments are now processed in the order they were attached.
241
 
242
  == CHANGELOG ==
 
 
 
243
  = 1.8.10 (2016-10-24) =
244
  * New filter postie_place_media - allows markup to be changed when #img# references are being replaced.
245
  * New filter postie_place_media_before - allows markup to be changed when attachment templates are placed before the content.
@@ -1392,4 +1395,3 @@ plugin. And the rest is history :)
1392
  *
1393
  = 0.1 - 2004-06 =
1394
  * First release
1395
-
6
  Tags: e-mail, email, post-by-email
7
  Requires at least: 3.3.0
8
  Tested up to: 4.6.1
9
+ Stable tag: 1.8.11
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
240
  Attachments are now processed in the order they were attached.
241
 
242
  == CHANGELOG ==
243
+ = 1.8.11 (2016-10-24) =
244
+ * Support Dovecot IMAP server better
245
+
246
  = 1.8.10 (2016-10-24) =
247
  * New filter postie_place_media - allows markup to be changed when #img# references are being replaced.
248
  * New filter postie_place_media_before - allows markup to be changed when attachment templates are placed before the content.
1395
  *
1396
  = 0.1 - 2004-06 =
1397
  * First release