Version Description
(2015-07-07) = * Fixed attachment uploading bug when the type & extension weren't available. * Clarified "Filter newlines" setting description. * Better support for Exchange 2010+ thanks to Andrew Chaplin * New action hook - postie_file_added
Download this release
Release Info
Developer | WayneAllen |
Plugin | Postie |
Version | 1.7.0 |
Comparing to | |
See all releases |
Code changes from version 1.6.19 to 1.7.0
- config_form.php +1 -1
- docs/Changes.txt +7 -1
- docs/Postie.txt +2 -2
- docs/TODO.txt +5 -5
- postie-functions.php +35 -18
- postie.php +3 -3
- postieIMAP.php +8 -8
- readme.txt +9 -3
config_form.php
CHANGED
@@ -434,7 +434,7 @@
|
|
434 |
</tr>
|
435 |
|
436 |
<?php
|
437 |
-
echo BuildBooleanSelect(__("Filter newlines", "postie"), "postie-settings[filternewlines]", $filternewlines, __("
|
438 |
echo BuildBooleanSelect(__("Replace newline characters with html line breaks (<br />)", "postie"), "postie-settings[convertnewline]", $convertnewline, __("Filter newlines must be turned on for this option to take effect", "postie"));
|
439 |
echo BuildBooleanSelect(__("Return rejected mail to sender", "postie"), "postie-settings[return_to_sender]", $return_to_sender);
|
440 |
?>
|
434 |
</tr>
|
435 |
|
436 |
<?php
|
437 |
+
echo BuildBooleanSelect(__("Filter newlines", "postie"), "postie-settings[filternewlines]", $filternewlines, __("Whether to strip newlines from plain text. Set to no if using markdown or textitle syntax", "postie"));
|
438 |
echo BuildBooleanSelect(__("Replace newline characters with html line breaks (<br />)", "postie"), "postie-settings[convertnewline]", $convertnewline, __("Filter newlines must be turned on for this option to take effect", "postie"));
|
439 |
echo BuildBooleanSelect(__("Return rejected mail to sender", "postie"), "postie-settings[return_to_sender]", $return_to_sender);
|
440 |
?>
|
docs/Changes.txt
CHANGED
@@ -27,6 +27,12 @@ All script, style and body tags are stripped from html emails.
|
|
27 |
Attachments are now processed in the order they were attached.
|
28 |
|
29 |
== CHANGELOG ==
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
= 1.6.19 (2015-05-04) =
|
31 |
* Reduced the number of messages sent to the log for successful runs
|
32 |
* Rename the disable_kses_content() function to postie_disable_kses_content() to fix a conflict with DAP WP LiveLinks Plugin
|
@@ -682,7 +688,7 @@ code better. In June/July 2005 I discovered a little plugin by Chris J Davis (ht
|
|
682 |
feature to it (basically a bookmarklet). In the process I started looking at his code and realized how much you could do with the plugin system
|
683 |
available in Word Press.
|
684 |
|
685 |
-
So I decided to make an
|
686 |
plugin. And the rest is history :)
|
687 |
|
688 |
* BUGFIX -problem with subject
|
27 |
Attachments are now processed in the order they were attached.
|
28 |
|
29 |
== CHANGELOG ==
|
30 |
+
= 1.7.0 (2015-07-07) =
|
31 |
+
* Fixed attachment uploading bug when the type & extension weren't available.
|
32 |
+
* Clarified "Filter newlines" setting description.
|
33 |
+
* Better support for Exchange 2010+ thanks to Andrew Chaplin
|
34 |
+
* New action hook - postie_file_added
|
35 |
+
|
36 |
= 1.6.19 (2015-05-04) =
|
37 |
* Reduced the number of messages sent to the log for successful runs
|
38 |
* Rename the disable_kses_content() function to postie_disable_kses_content() to fix a conflict with DAP WP LiveLinks Plugin
|
688 |
feature to it (basically a bookmarklet). In the process I started looking at his code and realized how much you could do with the plugin system
|
689 |
available in Word Press.
|
690 |
|
691 |
+
So I decided to make an official fork. I put up an article on my blog asking for new names. I picked Postie. I then modified the code to be a proper
|
692 |
plugin. And the rest is history :)
|
693 |
|
694 |
* BUGFIX -problem with subject
|
docs/Postie.txt
CHANGED
@@ -5,8 +5,8 @@ Author URI: http://allens-home.com/
|
|
5 |
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.2.
|
9 |
-
Stable tag: 1.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
5 |
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.2.2
|
9 |
+
Stable tag: 1.7.0
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
docs/TODO.txt
CHANGED
@@ -1,4 +1,7 @@
|
|
|
|
|
|
1 |
Verify that WP is honoring the wp_set_current_user() call. I.e. if the user is not an "author" role can they publish?
|
|
|
2 |
Option to not process forwarded emails (getPostAuthorDetails)
|
3 |
Separate out video linkifying from normal url linkifying - separate settings
|
4 |
Add Message-ID header value to custom field (postie_message_id?) to both posts and comments.
|
@@ -14,6 +17,7 @@ Comment not being created when subject contains category command []. I.e. listse
|
|
14 |
date: tag is being detected in body when not wanted
|
15 |
Update tag_* and filter_* to handle HTML (per tag_Tags)
|
16 |
dynamically determine video size (height/width) - https://code.google.com/p/phpvideotoolkit/
|
|
|
17 |
gallery logic does not handle both images and non-images
|
18 |
plugin conflict - Image Rotation Fixer/Image Rotation Repair
|
19 |
send email notice when attachments are rejected.
|
@@ -81,14 +85,10 @@ http://www.yaconiello.com/blog/how-to-write-wordpress-plugin/
|
|
81 |
|
82 |
setting to turn off individual tags
|
83 |
process single email at a time and don't delete unless successful
|
84 |
-
plugin mechanism to add new tags (and define "built-in ones")
|
85 |
fix postie settings http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
86 |
Make sure all failures are sent to admin (option?) failed attachments, etc.
|
87 |
Option to send logs to support
|
88 |
Enhance #img# to specify the featured image
|
89 |
"yoast" style admin sidebar - see clicky by yoast
|
90 |
-
replace native imap MIME parser with flourish - http://flourishlib.com/docs/fMailbox or Hoard - see "Post By Email" plugin https://wordpress.org/plugins/post-by-email/
|
91 |
provide a location for custom icons. update docs about location.
|
92 |
-
handle condition where only one of text/plain & text/html is supplied, but Preferred Text Type is set to the opposite.
|
93 |
-
change all Postie command to use a more consistent and easy to parse syntax
|
94 |
-
Use standard shortcode syntax. I.e. [postie date="Jan 1, 2014"]
|
1 |
+
Preferred text type: just html, just plain, html fallback to plain
|
2 |
+
Change successful post message to take post status into account (i.e. draft really isn't posted - possible link to publish draft?)
|
3 |
Verify that WP is honoring the wp_set_current_user() call. I.e. if the user is not an "author" role can they publish?
|
4 |
+
Test server port combination by opening a socket connection to see if any service responds. (via ajax call)
|
5 |
Option to not process forwarded emails (getPostAuthorDetails)
|
6 |
Separate out video linkifying from normal url linkifying - separate settings
|
7 |
Add Message-ID header value to custom field (postie_message_id?) to both posts and comments.
|
17 |
date: tag is being detected in body when not wanted
|
18 |
Update tag_* and filter_* to handle HTML (per tag_Tags)
|
19 |
dynamically determine video size (height/width) - https://code.google.com/p/phpvideotoolkit/
|
20 |
+
new video template with <video> tag
|
21 |
gallery logic does not handle both images and non-images
|
22 |
plugin conflict - Image Rotation Fixer/Image Rotation Repair
|
23 |
send email notice when attachments are rejected.
|
85 |
|
86 |
setting to turn off individual tags
|
87 |
process single email at a time and don't delete unless successful
|
|
|
88 |
fix postie settings http://alisothegeek.com/2011/01/wordpress-settings-api-tutorial-1/
|
89 |
Make sure all failures are sent to admin (option?) failed attachments, etc.
|
90 |
Option to send logs to support
|
91 |
Enhance #img# to specify the featured image
|
92 |
"yoast" style admin sidebar - see clicky by yoast
|
93 |
+
replace native imap MIME parser with flourish - http://flourishlib.com/docs/fMailbox or Hoard http://dev.horde.org/imap_client/install.php - see "Post By Email" plugin https://wordpress.org/plugins/post-by-email/
|
94 |
provide a location for custom icons. update docs about location.
|
|
|
|
|
|
postie-functions.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
$Id: postie-functions.php
|
4 |
*/
|
5 |
|
6 |
//to turn on debug output add the following line to wp-config.php
|
@@ -237,6 +237,15 @@ function CreatePost($poster, $mimeDecodedEmail, $post_id, &$is_reply, $config, $
|
|
237 |
DebugEcho("CreatePost: '$content'");
|
238 |
DebugDump($attachments);
|
239 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
240 |
|
241 |
$subject = GetSubject($mimeDecodedEmail, $content, $config);
|
242 |
|
@@ -1361,7 +1370,6 @@ function filter_CleanHtml($content) {
|
|
1361 |
* @return integer|NULL
|
1362 |
*/
|
1363 |
function ValidatePoster(&$mimeDecodedEmail, $config) {
|
1364 |
-
$test_email = '';
|
1365 |
extract($config);
|
1366 |
$poster = NULL;
|
1367 |
$from = "";
|
@@ -1437,7 +1445,7 @@ function ValidatePoster(&$mimeDecodedEmail, $config) {
|
|
1437 |
EchoInfo('Invalid sender: ' . htmlentities($from) . "! Not adding email!");
|
1438 |
if ($forward_rejected_mail) {
|
1439 |
$admin_email = get_option("admin_email");
|
1440 |
-
if (MailToRecipients($mimeDecodedEmail,
|
1441 |
EchoInfo("A copy of the message has been forwarded to the administrator.");
|
1442 |
} else {
|
1443 |
EchoInfo("The message was unable to be forwarded to the adminstrator.");
|
@@ -1874,18 +1882,17 @@ function postie_media_handle_upload($part, $post_id, $poster, $generate_thubnail
|
|
1874 |
}
|
1875 |
|
1876 |
$file = postie_handle_upload($the_file, $overrides, $time);
|
1877 |
-
|
1878 |
|
1879 |
if (isset($file['error'])) {
|
1880 |
DebugDump($file['error']);
|
1881 |
-
//throw new Exception($file['error']);
|
1882 |
return new WP_Error('upload_error', $file['error']);
|
1883 |
}
|
1884 |
|
1885 |
$url = $file['url'];
|
1886 |
$type = $file['type'];
|
1887 |
-
$
|
1888 |
-
$title = preg_replace('/\.[^.]+$/', '', basename($
|
1889 |
$content = '';
|
1890 |
|
1891 |
// use image exif/iptc data for title and caption defaults if possible
|
@@ -1893,7 +1900,7 @@ function postie_media_handle_upload($part, $post_id, $poster, $generate_thubnail
|
|
1893 |
include_once(ABSPATH . '/wp-admin/includes/image.php');
|
1894 |
include_once(ABSPATH . '/wp-admin/includes/media.php');
|
1895 |
DebugEcho("reading metadata");
|
1896 |
-
if ($image_meta = @wp_read_image_metadata($
|
1897 |
if (trim($image_meta['title'])) {
|
1898 |
$title = $image_meta['title'];
|
1899 |
DebugEcho("Using metadata title: $title");
|
@@ -1918,12 +1925,14 @@ function postie_media_handle_upload($part, $post_id, $poster, $generate_thubnail
|
|
1918 |
|
1919 |
// Save the data
|
1920 |
DebugEcho("before wp_insert_attachment");
|
1921 |
-
$id = wp_insert_attachment($attachment, $
|
1922 |
DebugEcho("after wp_insert_attachment: attachement id: $id");
|
1923 |
|
1924 |
if (!is_wp_error($id)) {
|
|
|
|
|
1925 |
if ($generate_thubnails) {
|
1926 |
-
$amd = wp_generate_attachment_metadata($id, $
|
1927 |
DebugEcho("wp_generate_attachment_metadata");
|
1928 |
//DebugDump($amd);
|
1929 |
wp_update_attachment_metadata($id, $amd);
|
@@ -1991,19 +2000,27 @@ function postie_handle_upload(&$file, $overrides = false, $time = null) {
|
|
1991 |
return $upload_error_handler($file, __('Specified file failed upload test.'));
|
1992 |
}
|
1993 |
|
1994 |
-
extract($wp_filetype);
|
|
|
|
|
1995 |
|
1996 |
-
if ((
|
1997 |
-
return $upload_error_handler($file, __('File type does not meet security guidelines. Try another.'));
|
1998 |
-
}
|
1999 |
-
if (!$ext) {
|
2000 |
$ext = ltrim(strrchr($file['name'], '.'), '.');
|
2001 |
}
|
2002 |
-
if (
|
2003 |
-
$
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004 |
}
|
|
|
2005 |
// A writable uploads dir will pass this test. Again, there's no point overriding this one.
|
2006 |
if (!( ( $uploads = wp_upload_dir($time) ) && false === $uploads['error'] )) {
|
|
|
2007 |
return $upload_error_handler($file, $uploads['error']);
|
2008 |
}
|
2009 |
// fix filename (encode non-standard characters)
|
@@ -2039,7 +2056,7 @@ function postie_handle_upload(&$file, $overrides = false, $time = null) {
|
|
2039 |
$url = $uploads['url'] . "/$filename";
|
2040 |
|
2041 |
DebugEcho("upload: before apply_filters");
|
2042 |
-
$return = apply_filters('wp_handle_upload', array('file' => $new_file, 'url' => $url, 'type' => $
|
2043 |
DebugEcho("upload: after apply_filters");
|
2044 |
|
2045 |
return $return;
|
1 |
<?php
|
2 |
/*
|
3 |
+
$Id: postie-functions.php 1194283 2015-07-07 17:40:16Z WayneAllen $
|
4 |
*/
|
5 |
|
6 |
//to turn on debug output add the following line to wp-config.php
|
237 |
DebugEcho("CreatePost: '$content'");
|
238 |
DebugDump($attachments);
|
239 |
}
|
240 |
+
if (IsDebugMode()) {
|
241 |
+
$dname = POSTIE_ROOT . DIRECTORY_SEPARATOR . "test_emails" . DIRECTORY_SEPARATOR;
|
242 |
+
if (is_dir($dname)) {
|
243 |
+
$fname = $dname . sanitize_file_name($mimeDecodedEmail->headers["message-id"]);
|
244 |
+
$file = fopen($fname . ".content.txt ", "w");
|
245 |
+
fwrite($file, $content);
|
246 |
+
fclose($file);
|
247 |
+
}
|
248 |
+
}
|
249 |
|
250 |
$subject = GetSubject($mimeDecodedEmail, $content, $config);
|
251 |
|
1370 |
* @return integer|NULL
|
1371 |
*/
|
1372 |
function ValidatePoster(&$mimeDecodedEmail, $config) {
|
|
|
1373 |
extract($config);
|
1374 |
$poster = NULL;
|
1375 |
$from = "";
|
1445 |
EchoInfo('Invalid sender: ' . htmlentities($from) . "! Not adding email!");
|
1446 |
if ($forward_rejected_mail) {
|
1447 |
$admin_email = get_option("admin_email");
|
1448 |
+
if (MailToRecipients($mimeDecodedEmail, false, array($admin_email), $return_to_sender)) {
|
1449 |
EchoInfo("A copy of the message has been forwarded to the administrator.");
|
1450 |
} else {
|
1451 |
EchoInfo("The message was unable to be forwarded to the adminstrator.");
|
1882 |
}
|
1883 |
|
1884 |
$file = postie_handle_upload($the_file, $overrides, $time);
|
1885 |
+
|
1886 |
|
1887 |
if (isset($file['error'])) {
|
1888 |
DebugDump($file['error']);
|
|
|
1889 |
return new WP_Error('upload_error', $file['error']);
|
1890 |
}
|
1891 |
|
1892 |
$url = $file['url'];
|
1893 |
$type = $file['type'];
|
1894 |
+
$filename = $file['file'];
|
1895 |
+
$title = preg_replace('/\.[^.]+$/', '', basename($filename));
|
1896 |
$content = '';
|
1897 |
|
1898 |
// use image exif/iptc data for title and caption defaults if possible
|
1900 |
include_once(ABSPATH . '/wp-admin/includes/image.php');
|
1901 |
include_once(ABSPATH . '/wp-admin/includes/media.php');
|
1902 |
DebugEcho("reading metadata");
|
1903 |
+
if ($image_meta = @wp_read_image_metadata($filename)) {
|
1904 |
if (trim($image_meta['title'])) {
|
1905 |
$title = $image_meta['title'];
|
1906 |
DebugEcho("Using metadata title: $title");
|
1925 |
|
1926 |
// Save the data
|
1927 |
DebugEcho("before wp_insert_attachment");
|
1928 |
+
$id = wp_insert_attachment($attachment, $filename, $post_id);
|
1929 |
DebugEcho("after wp_insert_attachment: attachement id: $id");
|
1930 |
|
1931 |
if (!is_wp_error($id)) {
|
1932 |
+
do_action('postie_file_added', $post_id, $id, $file);
|
1933 |
+
|
1934 |
if ($generate_thubnails) {
|
1935 |
+
$amd = wp_generate_attachment_metadata($id, $filename);
|
1936 |
DebugEcho("wp_generate_attachment_metadata");
|
1937 |
//DebugDump($amd);
|
1938 |
wp_update_attachment_metadata($id, $amd);
|
2000 |
return $upload_error_handler($file, __('Specified file failed upload test.'));
|
2001 |
}
|
2002 |
|
2003 |
+
//extract($wp_filetype);
|
2004 |
+
$mimetype = $wp_filetype['type'];
|
2005 |
+
$ext = $wp_filetype['ext'];
|
2006 |
|
2007 |
+
if (empty($ext)) {
|
|
|
|
|
|
|
2008 |
$ext = ltrim(strrchr($file['name'], '.'), '.');
|
2009 |
}
|
2010 |
+
if (empty($mimetype)) {
|
2011 |
+
$mimetype = $file['type'];
|
2012 |
+
}
|
2013 |
+
|
2014 |
+
DebugEcho("postie_handle_upload (type/ext): '$mimetype' / '$ext'");
|
2015 |
+
|
2016 |
+
if ((empty($mimetype) && empty($ext)) && !current_user_can('unfiltered_upload')) {
|
2017 |
+
DebugEcho("postie_handle_upload: no type/ext & user restricted");
|
2018 |
+
return $upload_error_handler($file, __('File type does not meet security guidelines. Try another.'));
|
2019 |
}
|
2020 |
+
|
2021 |
// A writable uploads dir will pass this test. Again, there's no point overriding this one.
|
2022 |
if (!( ( $uploads = wp_upload_dir($time) ) && false === $uploads['error'] )) {
|
2023 |
+
DebugEcho("postie_handle_upload: directory not writable");
|
2024 |
return $upload_error_handler($file, $uploads['error']);
|
2025 |
}
|
2026 |
// fix filename (encode non-standard characters)
|
2056 |
$url = $uploads['url'] . "/$filename";
|
2057 |
|
2058 |
DebugEcho("upload: before apply_filters");
|
2059 |
+
$return = apply_filters('wp_handle_upload', array('file' => $new_file, 'url' => $url, 'type' => $mimetype));
|
2060 |
DebugEcho("upload: after apply_filters");
|
2061 |
|
2062 |
return $return;
|
postie.php
CHANGED
@@ -4,7 +4,7 @@
|
|
4 |
Plugin Name: Postie
|
5 |
Plugin URI: http://PostiePlugin.com/
|
6 |
Description: Create posts via email. Signifigantly upgrades the Post by Email features of Word Press.
|
7 |
-
Version: 1.
|
8 |
Author: Wayne Allen
|
9 |
Author URI: http://PostiePlugin.com/
|
10 |
License: GPL2
|
@@ -27,11 +27,11 @@
|
|
27 |
*/
|
28 |
|
29 |
/*
|
30 |
-
$Id: postie.php
|
31 |
*/
|
32 |
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
|
33 |
|
34 |
-
define('POSTIE_VERSION', '1.
|
35 |
define("POSTIE_ROOT", dirname(__FILE__));
|
36 |
define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
|
37 |
|
4 |
Plugin Name: Postie
|
5 |
Plugin URI: http://PostiePlugin.com/
|
6 |
Description: Create posts via email. Signifigantly upgrades the Post by Email features of Word Press.
|
7 |
+
Version: 1.7.0
|
8 |
Author: Wayne Allen
|
9 |
Author URI: http://PostiePlugin.com/
|
10 |
License: GPL2
|
27 |
*/
|
28 |
|
29 |
/*
|
30 |
+
$Id: postie.php 1194284 2015-07-07 17:42:31Z WayneAllen $
|
31 |
*/
|
32 |
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
|
33 |
|
34 |
+
define('POSTIE_VERSION', '1.7.0');
|
35 |
define("POSTIE_ROOT", dirname(__FILE__));
|
36 |
define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
|
37 |
|
postieIMAP.php
CHANGED
@@ -22,7 +22,7 @@ class PostieIMAP {
|
|
22 |
var $_self_cert;
|
23 |
var $_tls_on;
|
24 |
var $_connection;
|
25 |
-
var $
|
26 |
|
27 |
function PostieIMAP($protocol = "imap", $ssl_on = false, $self_cert = true) {
|
28 |
$this->_connected = false;
|
@@ -76,17 +76,17 @@ class PostieIMAP {
|
|
76 |
if (preg_match("/google|gmail/i", $server)) {
|
77 |
//Fix from Jim Hodgson http://www.jimhodgson.com/2006/07/19/postie/
|
78 |
DebugEcho($this->_protocol . ": using Google INBOX");
|
79 |
-
$this->
|
80 |
} else {
|
81 |
-
$this->
|
82 |
}
|
83 |
-
DebugEcho($this->_protocol . ": connection string - {$this->
|
84 |
//Exchange connection, but requires PHP 5.3.2
|
85 |
if (version_compare(phpversion(), '5.3.2', '<')) {
|
86 |
-
$this->_connection = imap_open($this->
|
87 |
} else {
|
88 |
DebugEcho($this->_protocol . ": disabling GSSAPI");
|
89 |
-
$this->_connection = imap_open($this->
|
90 |
}
|
91 |
|
92 |
if ($this->_connection) {
|
@@ -103,10 +103,10 @@ class PostieIMAP {
|
|
103 |
* @return integer
|
104 |
*/
|
105 |
function getNumberOfMessages() {
|
106 |
-
$status = imap_status($this->_connection, $this->
|
107 |
DebugDump($status);
|
108 |
if ($status) {
|
109 |
-
return $status->messages;
|
110 |
} else {
|
111 |
LogInfo("Error imap_status did not return a value");
|
112 |
//DebugDump($this);
|
22 |
var $_self_cert;
|
23 |
var $_tls_on;
|
24 |
var $_connection;
|
25 |
+
var $_mailbox;
|
26 |
|
27 |
function PostieIMAP($protocol = "imap", $ssl_on = false, $self_cert = true) {
|
28 |
$this->_connected = false;
|
76 |
if (preg_match("/google|gmail/i", $server)) {
|
77 |
//Fix from Jim Hodgson http://www.jimhodgson.com/2006/07/19/postie/
|
78 |
DebugEcho($this->_protocol . ": using Google INBOX");
|
79 |
+
$this->_mailbox = "{" . $server . ":" . $port . $option . "}INBOX";
|
80 |
} else {
|
81 |
+
$this->_mailbox = "{" . $server . ":" . $port . $option . "}";
|
82 |
}
|
83 |
+
DebugEcho($this->_protocol . ": connection string - {$this->_mailbox}");
|
84 |
//Exchange connection, but requires PHP 5.3.2
|
85 |
if (version_compare(phpversion(), '5.3.2', '<')) {
|
86 |
+
$this->_connection = imap_open($this->_mailbox, $login, $password);
|
87 |
} else {
|
88 |
DebugEcho($this->_protocol . ": disabling GSSAPI");
|
89 |
+
$this->_connection = imap_open($this->_mailbox, $login, $password, NULL, 1, array('DISABLE_AUTHENTICATOR' => 'GSSAPI'));
|
90 |
}
|
91 |
|
92 |
if ($this->_connection) {
|
103 |
* @return integer
|
104 |
*/
|
105 |
function getNumberOfMessages() {
|
106 |
+
$status = imap_status($this->_connection, $this->_mailbox, SA_ALL);
|
107 |
DebugDump($status);
|
108 |
if ($status) {
|
109 |
+
return max($status->messages, imap_num_msg($this->_connection));
|
110 |
} else {
|
111 |
LogInfo("Error imap_status did not return a value");
|
112 |
//DebugDump($this);
|
readme.txt
CHANGED
@@ -5,8 +5,8 @@ Author URI: http://allens-home.com/
|
|
5 |
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.2.
|
9 |
-
Stable tag: 1.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -234,6 +234,12 @@ All script, style and body tags are stripped from html emails.
|
|
234 |
Attachments are now processed in the order they were attached.
|
235 |
|
236 |
== CHANGELOG ==
|
|
|
|
|
|
|
|
|
|
|
|
|
237 |
= 1.6.19 (2015-05-04) =
|
238 |
* Reduced the number of messages sent to the log for successful runs
|
239 |
* Rename the disable_kses_content() function to postie_disable_kses_content() to fix a conflict with DAP WP LiveLinks Plugin
|
@@ -889,7 +895,7 @@ code better. In June/July 2005 I discovered a little plugin by Chris J Davis (ht
|
|
889 |
feature to it (basically a bookmarklet). In the process I started looking at his code and realized how much you could do with the plugin system
|
890 |
available in Word Press.
|
891 |
|
892 |
-
So I decided to make an
|
893 |
plugin. And the rest is history :)
|
894 |
|
895 |
* BUGFIX -problem with subject
|
5 |
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.2.2
|
9 |
+
Stable tag: 1.7.0
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
234 |
Attachments are now processed in the order they were attached.
|
235 |
|
236 |
== CHANGELOG ==
|
237 |
+
= 1.7.0 (2015-07-07) =
|
238 |
+
* Fixed attachment uploading bug when the type & extension weren't available.
|
239 |
+
* Clarified "Filter newlines" setting description.
|
240 |
+
* Better support for Exchange 2010+ thanks to Andrew Chaplin
|
241 |
+
* New action hook - postie_file_added
|
242 |
+
|
243 |
= 1.6.19 (2015-05-04) =
|
244 |
* Reduced the number of messages sent to the log for successful runs
|
245 |
* Rename the disable_kses_content() function to postie_disable_kses_content() to fix a conflict with DAP WP LiveLinks Plugin
|
895 |
feature to it (basically a bookmarklet). In the process I started looking at his code and realized how much you could do with the plugin system
|
896 |
available in Word Press.
|
897 |
|
898 |
+
So I decided to make an official fork. I put up an article on my blog asking for new names. I picked Postie. I then modified the code to be a proper
|
899 |
plugin. And the rest is history :)
|
900 |
|
901 |
* BUGFIX -problem with subject
|