Version Description
(2015-10-13) = * Fix bug where linkify was messing up CID reference
Download this release
Release Info
Developer | WayneAllen |
Plugin | Postie |
Version | 1.7.18 |
Comparing to | |
See all releases |
Code changes from version 1.7.17 to 1.7.18
- docs/Changes.txt +3 -0
- docs/Postie.txt +1 -1
- postie-functions.php +134 -134
- postie.php +3 -3
- readme.txt +4 -1
docs/Changes.txt
CHANGED
@@ -27,6 +27,9 @@ 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.7.17 (2015-10-12) =
|
31 |
* New action, postie_log_error
|
32 |
* New action, postie_log_debug
|
27 |
Attachments are now processed in the order they were attached.
|
28 |
|
29 |
== CHANGELOG ==
|
30 |
+
= 1.7.18 (2015-10-13) =
|
31 |
+
* Fix bug where linkify was messing up CID reference
|
32 |
+
|
33 |
= 1.7.17 (2015-10-12) =
|
34 |
* New action, postie_log_error
|
35 |
* New action, postie_log_debug
|
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.3.1
|
9 |
-
Stable tag: 1.7.
|
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.3.1
|
9 |
+
Stable tag: 1.7.18
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
postie-functions.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*
|
3 |
-
$Id: postie-functions.php
|
4 |
*/
|
5 |
|
6 |
class PostiePostModifiers {
|
@@ -296,6 +296,12 @@ function CreatePost($poster, $mimeDecodedEmail, $post_id, &$is_reply, $config, $
|
|
296 |
DebugEcho("post status: $content");
|
297 |
}
|
298 |
|
|
|
|
|
|
|
|
|
|
|
|
|
299 |
if ($config['converturls']) {
|
300 |
$content = filter_Videos($content, $config['shortcode']); //videos first so linkify doesn't mess with them
|
301 |
if ($fulldebug) {
|
@@ -313,11 +319,6 @@ function CreatePost($poster, $mimeDecodedEmail, $post_id, &$is_reply, $config, $
|
|
313 |
DebugEcho("post vodafone: $content");
|
314 |
}
|
315 |
|
316 |
-
filter_ReplaceImageCIDs($content, $attachments, $config);
|
317 |
-
if ($fulldebug) {
|
318 |
-
DebugEcho("post cid: $content");
|
319 |
-
}
|
320 |
-
|
321 |
$customImages = tag_CustomImageField($content, $attachments, $config);
|
322 |
if ($fulldebug) {
|
323 |
DebugEcho("post custom: $content");
|
@@ -3503,17 +3504,17 @@ function postie_test_config() {
|
|
3503 |
?>
|
3504 |
<div class="wrap">
|
3505 |
<h1>Postie Configuration Test</h1>
|
3506 |
-
|
3507 |
-
|
3508 |
-
|
3509 |
|
3510 |
<h2>Clock Tests</h2>
|
3511 |
<p>This shows what time it would be if you posted right now</p>
|
3512 |
-
|
3513 |
-
|
3514 |
-
|
3515 |
-
|
3516 |
-
|
3517 |
<h2>Encoding</h2>
|
3518 |
<?php
|
3519 |
EchoInfo("default_charset: " . ini_get('default_charset'));
|
@@ -3530,146 +3531,145 @@ function postie_test_config() {
|
|
3530 |
?>
|
3531 |
<h2>Connect to Mail Host</h2>
|
3532 |
|
3533 |
-
|
3534 |
-
|
3535 |
-
|
3536 |
-
|
3537 |
-
|
3538 |
-
|
3539 |
|
3540 |
-
|
3541 |
-
|
3542 |
-
|
3543 |
-
|
3544 |
-
|
3545 |
-
|
3546 |
-
} else {
|
3547 |
-
require_once("postieIMAP.php");
|
3548 |
-
$mail_server = &PostieIMAP::Factory($config["input_protocol"]);
|
3549 |
-
if ($config['email_tls']) {
|
3550 |
-
$mail_server->TLSOn();
|
3551 |
-
}
|
3552 |
-
if (!$mail_server->connect($config["mail_server"], $config["mail_server_port"], $config["mail_userid"], $config["mail_password"])) {
|
3553 |
-
EchoInfo("Unable to connect. The server said:");
|
3554 |
-
EchoInfo($mail_server->error());
|
3555 |
} else {
|
3556 |
-
|
3557 |
-
|
3558 |
-
$
|
3559 |
-
|
3560 |
-
|
3561 |
-
|
3562 |
-
|
3563 |
-
|
3564 |
-
require_once(ABSPATH . WPINC . DIRECTORY_SEPARATOR . 'class-pop3.php');
|
3565 |
-
$pop3 = new POP3();
|
3566 |
-
if (defined('POSTIE_DEBUG')) {
|
3567 |
-
$pop3->DEBUG = POSTIE_DEBUG;
|
3568 |
-
}
|
3569 |
-
if (!$pop3->connect($config["mail_server"], $config["mail_server_port"])) {
|
3570 |
-
EchoInfo("Unable to connect. The server said:" . $pop3->ERROR);
|
3571 |
-
} else {
|
3572 |
-
EchoInfo("Sucessful " . strtoupper($config['input_protocol']) . " connection on port {$config["mail_server_port"]}");
|
3573 |
-
$msgs = $pop3->login($config["mail_userid"], $config["mail_password"]);
|
3574 |
-
if ($msgs === false) {
|
3575 |
-
//workaround for bug reported here Apr 12, 2013
|
3576 |
-
//https://sourceforge.net/tracker/?func=detail&atid=100311&aid=3610701&group_id=311
|
3577 |
-
//originally repoted here:
|
3578 |
-
//https://core.trac.wordpress.org/ticket/10587
|
3579 |
-
if (empty($pop3->ERROR)) {
|
3580 |
-
EchoInfo("No waiting messages");
|
3581 |
} else {
|
3582 |
-
EchoInfo("
|
|
|
|
|
3583 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3584 |
} else {
|
3585 |
-
EchoInfo("
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3586 |
}
|
3587 |
-
|
3588 |
-
|
3589 |
-
|
3590 |
-
}
|
3591 |
-
?>
|
3592 |
</div>
|
3593 |
-
|
3594 |
-
|
3595 |
|
3596 |
-
|
3597 |
-
|
3598 |
-
|
3599 |
-
|
3600 |
-
|
3601 |
|
3602 |
-
|
3603 |
-
|
3604 |
-
|
3605 |
-
|
3606 |
-
|
3607 |
-
|
3608 |
-
|
3609 |
|
3610 |
-
|
3611 |
-
|
3612 |
-
|
3613 |
-
|
3614 |
-
|
3615 |
-
|
3616 |
-
|
3617 |
-
|
3618 |
|
3619 |
-
|
3620 |
-
|
3621 |
-
|
3622 |
|
3623 |
-
|
3624 |
-
|
3625 |
-
|
3626 |
-
|
3627 |
|
3628 |
-
|
3629 |
-
|
3630 |
|
3631 |
-
|
3632 |
|
3633 |
-
|
3634 |
-
|
3635 |
-
|
3636 |
|
3637 |
-
|
3638 |
|
3639 |
-
|
3640 |
-
|
3641 |
-
|
3642 |
-
|
3643 |
-
|
3644 |
-
|
3645 |
-
|
3646 |
-
|
3647 |
-
|
3648 |
-
|
3649 |
-
|
3650 |
-
|
3651 |
-
|
3652 |
-
|
3653 |
-
|
3654 |
|
3655 |
-
|
3656 |
|
3657 |
-
|
3658 |
|
3659 |
-
|
3660 |
-
|
3661 |
-
|
3662 |
-
|
3663 |
-
|
3664 |
-
|
3665 |
-
|
3666 |
-
}
|
3667 |
-
flush();
|
3668 |
}
|
3669 |
-
|
|
|
|
|
3670 |
|
3671 |
-
|
3672 |
-
|
3673 |
-
}
|
3674 |
}
|
3675 |
-
|
1 |
<?php
|
2 |
/*
|
3 |
+
$Id: postie-functions.php 1265241 2015-10-13 20:16:04Z WayneAllen $
|
4 |
*/
|
5 |
|
6 |
class PostiePostModifiers {
|
296 |
DebugEcho("post status: $content");
|
297 |
}
|
298 |
|
299 |
+
//handle CID before linkify
|
300 |
+
filter_ReplaceImageCIDs($content, $attachments, $config);
|
301 |
+
if ($fulldebug) {
|
302 |
+
DebugEcho("post cid: $content");
|
303 |
+
}
|
304 |
+
|
305 |
if ($config['converturls']) {
|
306 |
$content = filter_Videos($content, $config['shortcode']); //videos first so linkify doesn't mess with them
|
307 |
if ($fulldebug) {
|
319 |
DebugEcho("post vodafone: $content");
|
320 |
}
|
321 |
|
|
|
|
|
|
|
|
|
|
|
322 |
$customImages = tag_CustomImageField($content, $attachments, $config);
|
323 |
if ($fulldebug) {
|
324 |
DebugEcho("post custom: $content");
|
3504 |
?>
|
3505 |
<div class="wrap">
|
3506 |
<h1>Postie Configuration Test</h1>
|
3507 |
+
<?php
|
3508 |
+
postie_environment();
|
3509 |
+
?>
|
3510 |
|
3511 |
<h2>Clock Tests</h2>
|
3512 |
<p>This shows what time it would be if you posted right now</p>
|
3513 |
+
<?php
|
3514 |
+
$content = "";
|
3515 |
+
$data = tag_Delay($content, null, $config['time_offset']);
|
3516 |
+
EchoInfo("Post time: $data[0]");
|
3517 |
+
?>
|
3518 |
<h2>Encoding</h2>
|
3519 |
<?php
|
3520 |
EchoInfo("default_charset: " . ini_get('default_charset'));
|
3531 |
?>
|
3532 |
<h2>Connect to Mail Host</h2>
|
3533 |
|
3534 |
+
<?php
|
3535 |
+
if (!$config['mail_server'] || !$config['mail_server_port'] || !$config['mail_userid']) {
|
3536 |
+
EchoInfo("FAIL - server settings not complete");
|
3537 |
+
} else {
|
3538 |
+
DebugEcho("checking");
|
3539 |
+
}
|
3540 |
|
3541 |
+
switch (strtolower($config["input_protocol"])) {
|
3542 |
+
case 'imap':
|
3543 |
+
case 'imap-ssl':
|
3544 |
+
case 'pop3-ssl':
|
3545 |
+
if (!HasIMAPSupport()) {
|
3546 |
+
EchoInfo("Sorry - you do not have IMAP php module installed - it is required for this mail setting.");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3547 |
} else {
|
3548 |
+
require_once("postieIMAP.php");
|
3549 |
+
$mail_server = &PostieIMAP::Factory($config["input_protocol"]);
|
3550 |
+
if ($config['email_tls']) {
|
3551 |
+
$mail_server->TLSOn();
|
3552 |
+
}
|
3553 |
+
if (!$mail_server->connect($config["mail_server"], $config["mail_server_port"], $config["mail_userid"], $config["mail_password"])) {
|
3554 |
+
EchoInfo("Unable to connect. The server said:");
|
3555 |
+
EchoInfo($mail_server->error());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3556 |
} else {
|
3557 |
+
EchoInfo("Successful " . strtoupper($config['input_protocol']) . " connection on port {$config["mail_server_port"]}");
|
3558 |
+
EchoInfo("# of waiting messages: " . $mail_server->getNumberOfMessages());
|
3559 |
+
$mail_server->disconnect();
|
3560 |
}
|
3561 |
+
}
|
3562 |
+
break;
|
3563 |
+
case 'pop3':
|
3564 |
+
default:
|
3565 |
+
require_once(ABSPATH . WPINC . DIRECTORY_SEPARATOR . 'class-pop3.php');
|
3566 |
+
$pop3 = new POP3();
|
3567 |
+
if (defined('POSTIE_DEBUG')) {
|
3568 |
+
$pop3->DEBUG = POSTIE_DEBUG;
|
3569 |
+
}
|
3570 |
+
if (!$pop3->connect($config["mail_server"], $config["mail_server_port"])) {
|
3571 |
+
EchoInfo("Unable to connect. The server said:" . $pop3->ERROR);
|
3572 |
} else {
|
3573 |
+
EchoInfo("Sucessful " . strtoupper($config['input_protocol']) . " connection on port {$config["mail_server_port"]}");
|
3574 |
+
$msgs = $pop3->login($config["mail_userid"], $config["mail_password"]);
|
3575 |
+
if ($msgs === false) {
|
3576 |
+
//workaround for bug reported here Apr 12, 2013
|
3577 |
+
//https://sourceforge.net/tracker/?func=detail&atid=100311&aid=3610701&group_id=311
|
3578 |
+
//originally repoted here:
|
3579 |
+
//https://core.trac.wordpress.org/ticket/10587
|
3580 |
+
if (empty($pop3->ERROR)) {
|
3581 |
+
EchoInfo("No waiting messages");
|
3582 |
+
} else {
|
3583 |
+
EchoInfo("Unable to login. The server said:" . $pop3->ERROR);
|
3584 |
+
}
|
3585 |
+
} else {
|
3586 |
+
EchoInfo("# of waiting messages: $msgs");
|
3587 |
+
}
|
3588 |
+
$pop3->quit();
|
3589 |
}
|
3590 |
+
break;
|
3591 |
+
}
|
3592 |
+
?>
|
|
|
|
|
3593 |
</div>
|
3594 |
+
<?php
|
3595 |
+
}
|
3596 |
|
3597 |
+
function postie_get_mail() {
|
3598 |
+
require_once (plugin_dir_path(__FILE__) . 'mimedecode.php');
|
3599 |
+
if (!function_exists('file_get_html')) {
|
3600 |
+
require_once (plugin_dir_path(__FILE__) . 'simple_html_dom.php');
|
3601 |
+
}
|
3602 |
|
3603 |
+
$config = config_Read();
|
3604 |
+
if (true == $config['postie_log_error'] || (defined('POSTIE_DEBUG') && true == POSTIE_DEBUG)) {
|
3605 |
+
add_action('postie_log_error', 'postie_log_error');
|
3606 |
+
}
|
3607 |
+
if (true == $config['postie_log_debug'] || (defined('POSTIE_DEBUG') && true == POSTIE_DEBUG)) {
|
3608 |
+
add_action('postie_log_debug', 'postie_log_debug');
|
3609 |
+
}
|
3610 |
|
3611 |
+
EchoInfo("Starting mail fetch");
|
3612 |
+
postie_environment();
|
3613 |
+
$wp_content_path = dirname(dirname(dirname(__FILE__)));
|
3614 |
+
DebugEcho("wp_content_path: $wp_content_path");
|
3615 |
+
if (file_exists($wp_content_path . DIRECTORY_SEPARATOR . "filterPostie.php")) {
|
3616 |
+
DebugEcho("found filterPostie.php in $wp_content_path");
|
3617 |
+
include_once ($wp_content_path . DIRECTORY_SEPARATOR . "filterPostie.php");
|
3618 |
+
}
|
3619 |
|
3620 |
+
if (has_filter('postie_post')) {
|
3621 |
+
echo "Postie: filter 'postie_post' is depricated in favor of 'postie_post_before'";
|
3622 |
+
}
|
3623 |
|
3624 |
+
$test_email = null;
|
3625 |
+
if (!array_key_exists('maxemails', $config)) {
|
3626 |
+
$config['maxemails'] = 0;
|
3627 |
+
}
|
3628 |
|
3629 |
+
$emails = FetchMail($config['mail_server'], $config['mail_server_port'], $config['mail_userid'], $config['mail_password'], $config['input_protocol'], $config['time_offset'], $test_email, $config['delete_mail_after_processing'], $config['maxemails'], $config['email_tls']);
|
3630 |
+
$message = 'Done.';
|
3631 |
|
3632 |
+
EchoInfo(sprintf(__("There are %d messages to process", 'postie'), count($emails)));
|
3633 |
|
3634 |
+
if (function_exists('memory_get_usage')) {
|
3635 |
+
DebugEcho(__("memory at start of email processing:", 'postie') . memory_get_usage());
|
3636 |
+
}
|
3637 |
|
3638 |
+
DebugDump($config);
|
3639 |
|
3640 |
+
//loop through messages
|
3641 |
+
$message_number = 0;
|
3642 |
+
foreach ($emails as $email) {
|
3643 |
+
$message_number++;
|
3644 |
+
DebugEcho("$message_number: ------------------------------------");
|
3645 |
+
//sanity check to see if there is any info in the message
|
3646 |
+
if ($email == NULL) {
|
3647 |
+
$message = __('Dang, message is empty!', 'postie');
|
3648 |
+
EchoInfo("$message_number: $message");
|
3649 |
+
continue;
|
3650 |
+
} else if (($config['ignore_mail_state'] == false) && ( $email == 'already read')) {
|
3651 |
+
$message = __("Message is already marked 'read'.", 'postie');
|
3652 |
+
EchoInfo("$message_number: $message");
|
3653 |
+
continue;
|
3654 |
+
}
|
3655 |
|
3656 |
+
$mimeDecodedEmail = DecodeMIMEMail($email);
|
3657 |
|
3658 |
+
DebugEmailOutput($email, $mimeDecodedEmail);
|
3659 |
|
3660 |
+
//Check poster to see if a valid person
|
3661 |
+
$poster = ValidatePoster($mimeDecodedEmail, $config);
|
3662 |
+
if (!empty($poster)) {
|
3663 |
+
PostEmail($poster, $mimeDecodedEmail, $config);
|
3664 |
+
EchoInfo("$message_number: processed");
|
3665 |
+
} else {
|
3666 |
+
EchoInfo("Ignoring email - not authorized.");
|
|
|
|
|
3667 |
}
|
3668 |
+
flush();
|
3669 |
+
}
|
3670 |
+
EchoInfo("Mail fetch complete, $message_number emails");
|
3671 |
|
3672 |
+
if (function_exists('memory_get_usage')) {
|
3673 |
+
DebugEcho("memory at end of email processing:" . memory_get_usage());
|
|
|
3674 |
}
|
3675 |
+
}
|
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.7.
|
8 |
Author: Wayne Allen
|
9 |
Author URI: http://PostiePlugin.com/
|
10 |
License: GPL2
|
@@ -28,12 +28,12 @@
|
|
28 |
*/
|
29 |
|
30 |
/*
|
31 |
-
$Id: postie.php
|
32 |
*/
|
33 |
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
|
34 |
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
|
35 |
|
36 |
-
define('POSTIE_VERSION', '1.7.
|
37 |
define("POSTIE_ROOT", dirname(__FILE__));
|
38 |
define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
|
39 |
|
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.18
|
8 |
Author: Wayne Allen
|
9 |
Author URI: http://PostiePlugin.com/
|
10 |
License: GPL2
|
28 |
*/
|
29 |
|
30 |
/*
|
31 |
+
$Id: postie.php 1265241 2015-10-13 20:16:04Z WayneAllen $
|
32 |
*/
|
33 |
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "lib_autolink.php");
|
34 |
require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
|
35 |
|
36 |
+
define('POSTIE_VERSION', '1.7.18');
|
37 |
define("POSTIE_ROOT", dirname(__FILE__));
|
38 |
define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
|
39 |
|
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.3.1
|
9 |
-
Stable tag: 1.7.
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
@@ -235,6 +235,9 @@ All script, style and body tags are stripped from html emails.
|
|
235 |
Attachments are now processed in the order they were attached.
|
236 |
|
237 |
== CHANGELOG ==
|
|
|
|
|
|
|
238 |
= 1.7.17 (2015-10-12) =
|
239 |
* New action, postie_log_error
|
240 |
* New action, postie_log_debug
|
6 |
Tags: e-mail, email, post-by-email
|
7 |
Requires at least: 3.3.0
|
8 |
Tested up to: 4.3.1
|
9 |
+
Stable tag: 1.7.18
|
10 |
License: GPLv2 or later
|
11 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
12 |
|
235 |
Attachments are now processed in the order they were attached.
|
236 |
|
237 |
== CHANGELOG ==
|
238 |
+
= 1.7.18 (2015-10-13) =
|
239 |
+
* Fix bug where linkify was messing up CID reference
|
240 |
+
|
241 |
= 1.7.17 (2015-10-12) =
|
242 |
* New action, postie_log_error
|
243 |
* New action, postie_log_debug
|