Postie - Version 1.6.0

Version Description

Remote cron jobs need to update the URL used to kick off a manual email check. The new URL is http:///?postie=get-mail Accessing http:///wp-content/plugins/postie/get_mail.php will now receive a 403 error and a message stating what the new URL should be. The Postie menu is now at the main level rather than a Settings submenu.

Download this release

Release Info

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

Code changes from version 1.5.24 to 1.6.0

Files changed (12) hide show
  1. Revision +0 -2
  2. config_form.php +6 -7
  3. docs/Changes.txt +11 -1
  4. docs/Postie.txt +39 -7
  5. docs/TODO.txt +7 -2
  6. get_mail.php +11 -73
  7. postie-functions.php +169 -12
  8. postie-wp-config.php +0 -13
  9. postie.php +60 -22
  10. postie_test.php +0 -93
  11. readme.html +7 -277
  12. readme.txt +50 -9
Revision CHANGED
@@ -1,2 +0,0 @@
1
- Revision: 964822
2
- Last Changed Date: 2014-08-11 22:12:56 -0700 (Mon, 11 Aug 2014)
 
 
config_form.php CHANGED
@@ -11,7 +11,7 @@
11
  </form>
12
  </div>
13
  <h2>
14
- <a style='text-decoration:none' href='options-general.php?page=postie/postie.php'>
15
  <?php
16
  echo '<img src="' . plugins_url('images/mail.png', __FILE__) . '" alt="postie" />';
17
  _e('Postie Settings', 'postie');
@@ -20,7 +20,6 @@
20
  <span class="description">(v<?php _e(POSTIE_VERSION, 'postie'); ?>)</span>
21
  </h2>
22
 
23
-
24
  <?php
25
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-functions.php');
26
  if (isset($_POST["action"])) {
@@ -34,12 +33,12 @@
34
  $message = 1;
35
  break;
36
  case "test":
37
- include(POSTIE_ROOT . '/postie_test.php');
38
  exit;
39
  break;
40
  case "runpostie":
41
  EchoInfo("Checking for mail manually");
42
- include(POSTIE_ROOT . '/get_mail.php');
43
  exit;
44
  break;
45
  case "runpostie-debug":
@@ -47,7 +46,7 @@
47
  if (!defined('POSTIE_DEBUG')) {
48
  define('POSTIE_DEBUG', true);
49
  }
50
- include(POSTIE_ROOT . '/get_mail.php');
51
  exit;
52
  break;
53
  default:
@@ -159,7 +158,7 @@
159
  </span>
160
  </th>
161
  <td valign="top">
162
- <br/><input name='postie-settings[mail_server_port]' type="text" id='postie-settings-mail_server_port' value="<?php echo esc_attr($mail_server_port); ?>" size="6" />
163
  </td>
164
  </tr>
165
  <tr valign="top">
@@ -182,7 +181,7 @@
182
  <br />
183
  <span class='recommendation'><?php _e("Should be the same as your normal offset, but this lets you adjust it in cases where that doesn't work.", 'postie'); ?></span>
184
  </th>
185
- <td><input name='postie-settings[time_offset]' type="text" id='postie-settings-time_offset' size="2" value="<?php echo esc_attr($time_offset); ?>" />
186
  <?php _e('hours', 'postie') ?>
187
 
188
  </td>
11
  </form>
12
  </div>
13
  <h2>
14
+ <a style='text-decoration:none' href='admin.php?page=postie-settings'>
15
  <?php
16
  echo '<img src="' . plugins_url('images/mail.png', __FILE__) . '" alt="postie" />';
17
  _e('Postie Settings', 'postie');
20
  <span class="description">(v<?php _e(POSTIE_VERSION, 'postie'); ?>)</span>
21
  </h2>
22
 
 
23
  <?php
24
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-functions.php');
25
  if (isset($_POST["action"])) {
33
  $message = 1;
34
  break;
35
  case "test":
36
+ postie_test_config();
37
  exit;
38
  break;
39
  case "runpostie":
40
  EchoInfo("Checking for mail manually");
41
+ postie_get_mail();
42
  exit;
43
  break;
44
  case "runpostie-debug":
46
  if (!defined('POSTIE_DEBUG')) {
47
  define('POSTIE_DEBUG', true);
48
  }
49
+ postie_get_mail();
50
  exit;
51
  break;
52
  default:
158
  </span>
159
  </th>
160
  <td valign="top">
161
+ <br/><input name='postie-settings[mail_server_port]' style="width: 70px;" type="number" min="0" id='postie-settings-mail_server_port' value="<?php echo esc_attr($mail_server_port); ?>" size="6" />
162
  </td>
163
  </tr>
164
  <tr valign="top">
181
  <br />
182
  <span class='recommendation'><?php _e("Should be the same as your normal offset, but this lets you adjust it in cases where that doesn't work.", 'postie'); ?></span>
183
  </th>
184
+ <td><input style="width: 50px;" name='postie-settings[time_offset]' type="number" id='postie-settings-time_offset' size="2" value="<?php echo esc_attr($time_offset); ?>" min="0" />
185
  <?php _e('hours', 'postie') ?>
186
 
187
  </td>
docs/Changes.txt CHANGED
@@ -1,5 +1,10 @@
1
  == Upgrade Notice ==
2
 
 
 
 
 
 
3
  = 1.5.14 =
4
  The postie_post filter has be deprecated in favor of postie_post_before.
5
 
@@ -22,6 +27,11 @@ All script, style and body tags are stripped from html emails.
22
  Attachments are now processed in the order they were attached.
23
 
24
  == CHANGELOG ==
 
 
 
 
 
25
  = 1.5.24 (2014.08.12) =
26
  * Fix attachment renaming bug
27
  * Test with Wordpress 3.9.2
@@ -29,7 +39,7 @@ Attachments are now processed in the order they were attached.
29
  = 1.5.23 (2014.08.11) =
30
  * Remove PEAR/PEAR5 dependency which was causing errors on some systems
31
  * Call wp_handle_upload_prefilter before adding images to WP
32
- * Temporary new post is now draft status.
33
 
34
  = 1.5.22 (2014.06.10) =
35
  * Fix missing attachments for html messages
1
  == Upgrade Notice ==
2
 
3
+ = 1.6.0 =
4
+ Remote cron jobs need to update the URL used to kick off a manual email check. The new URL is http://<mysite>/?postie=get-mail
5
+ Accessing http://<mysite>/wp-content/plugins/postie/get_mail.php will now receive a 403 error and a message stating what the new URL should be.
6
+ The Postie menu is now at the main level rather than a Settings submenu.
7
+
8
  = 1.5.14 =
9
  The postie_post filter has be deprecated in favor of postie_post_before.
10
 
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
30
+ = 1.6.0 (2014.09.18) =
31
+ * Updated remote cron url to be more compatible with Wordpress
32
+ * The Postie menu has been moved out of the Settings menu to the top level
33
+ * Tested with Wordpress 4.0
34
+
35
  = 1.5.24 (2014.08.12) =
36
  * Fix attachment renaming bug
37
  * Test with Wordpress 3.9.2
39
  = 1.5.23 (2014.08.11) =
40
  * Remove PEAR/PEAR5 dependency which was causing errors on some systems
41
  * Call wp_handle_upload_prefilter before adding images to WP
42
+ * Temporary new post is now draft status
43
 
44
  = 1.5.22 (2014.06.10) =
45
  * Fix missing attachments for html messages
docs/Postie.txt CHANGED
@@ -3,22 +3,54 @@ Contributors: WayneAllen
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HPK99BJ88V4C2
4
  Author URI: http://allens-home.com/
5
  Plugin URI: http://PostiePlugin.com/
6
- Tags: e-mail, email
7
  Requires at least: 3.0
8
- Tested up to: 3.9.2
9
- Stable tag: 1.5.24
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
- Postie allows you to blog via e-mail, including many advanced features not found in WordPress's default post by e-mail feature.
14
 
15
  == Description ==
16
- Postie offers many advanced features for posting to your blog via e-mail,
17
  including the ability to assign categories by name, included pictures and
18
  videos, and automatically strip off signatures. It also has support for both
19
- imap and pop3, with the option for ssl with both. For usage notes, see the
20
  [other notes](other_notes) page
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  == Screenshots ==
23
 
24
- 1. Postie options (showing video and audio templates)
 
 
 
 
 
 
 
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HPK99BJ88V4C2
4
  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.0
8
+ Tested up to: 4.0
9
+ Stable tag: 1.6.0
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
+ Postie allows you to create posts via e-mail, including many advanced features not found in WordPress's default Post by Email feature.
14
 
15
  == Description ==
16
+ Postie offers many advanced features for creating posts via e-mail,
17
  including the ability to assign categories by name, included pictures and
18
  videos, and automatically strip off signatures. It also has support for both
19
+ IMAP and POP3, with the option for ssl with both. For usage notes, see the
20
  [other notes](other_notes) page
21
 
22
+ More info at http://PostiePlugin.com/
23
+
24
+ = Features =
25
+ * Supports IMAP or POP3 servers
26
+ * SSL and TLS supported
27
+ * Control who gets to post via email
28
+ * Set defaults for category, status, post format, post type and tags.
29
+ * Set title, category, status, post format, post type, date, comment control and tags in email to override defaults.
30
+ * Specify post excerpt (including excerpt only images).
31
+ * Use plain text or HTML version of email.
32
+ * Remove headers and footers from email (useful for posting from a mailing list).
33
+ * Optionally send emails on post success/failure.
34
+ * Control the types of attachments that are allowed by file name (wildcards allowed) and MIME type.
35
+ * Optionally make the first image the featured image.
36
+ * Gallery support.
37
+ * Control image placement with plain text email.
38
+ * Templates for images so they look the way you want.
39
+ * Templates for videos.
40
+ * Templates for audio files.
41
+ * Templates for other attachments.
42
+ * Email replies become comments.
43
+
44
+ = Developers =
45
+ * Several filter hooks available for custom processing of emails.
46
+
47
  == Screenshots ==
48
 
49
+ 1. Postie server options
50
+ 2. Postie user options
51
+ 3. Postie message options
52
+ 4. More message options
53
+ 5. Even more message options
54
+ 6. Image options
55
+ 7. Video and Audio options
56
+ 8. Attachment options
docs/TODO.txt CHANGED
@@ -9,9 +9,9 @@ gallery logic does not handle both images and non-images
9
  plugin conflict - Image Rotation Fixer/Image Rotation Repair
10
  send email notice when attachments are rejected.
11
  review http://wp.smashingmagazine.com/2011/11/23/improve-wordpress-plugins-readme-txt/
12
- more info in postie.txt
13
  configurable message for "post confirmation" - variable substitution
14
- add hook for post meta data change
15
  post type
16
  post format
17
  category
@@ -20,6 +20,9 @@ add hook for post meta data change
20
  excerpt
21
  tags
22
  author
 
 
 
23
  add hooks for content changes
24
  attachment template
25
  subject/title
@@ -78,6 +81,8 @@ provide a location for custom icons. update docs about location.
78
  handle condition where only one of text/plain & text/html is supplied, but Preferred Text Type is set to the opposite.
79
  change all Postie command to use a more consistent and easy to parse syntax
80
 
 
 
81
  commands with multiple data
82
  #custom name="field name" data="field value" custom#
83
 
9
  plugin conflict - Image Rotation Fixer/Image Rotation Repair
10
  send email notice when attachments are rejected.
11
  review http://wp.smashingmagazine.com/2011/11/23/improve-wordpress-plugins-readme-txt/
12
+ use wordpress plugin boilerplate http://wppb.io/
13
  configurable message for "post confirmation" - variable substitution
14
+ add hooks for post meta data change
15
  post type
16
  post format
17
  category
20
  excerpt
21
  tags
22
  author
23
+ add hook for email address extraction
24
+ author found - allows plugins to change who the author is, filter need access to message to extract from body or headers
25
+ to email - allows plugins to change category/tags based on the TO address (allows CC & BCC to be Postie mailbox)
26
  add hooks for content changes
27
  attachment template
28
  subject/title
81
  handle condition where only one of text/plain & text/html is supplied, but Preferred Text Type is set to the opposite.
82
  change all Postie command to use a more consistent and easy to parse syntax
83
 
84
+ Use standard shortcode syntax? I.e. [postie date="Jan 1, 2014"]
85
+
86
  commands with multiple data
87
  #custom name="field name" data="field value" custom#
88
 
get_mail.php CHANGED
@@ -1,74 +1,12 @@
1
  <?php
2
-
3
- require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-wp-config.php');
4
- require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'mimedecode.php');
5
- require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-functions.php');
6
- if (!function_exists('file_get_html')) {
7
- require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'simple_html_dom.php');
8
- }
9
-
10
- EchoInfo("Starting mail fetch");
11
- postie_environment();
12
- $wp_content_path = dirname(dirname(dirname(__FILE__)));
13
- DebugEcho("wp_content_path: $wp_content_path");
14
- if (file_exists($wp_content_path . DIRECTORY_SEPARATOR . "filterPostie.php")) {
15
- DebugEcho("found filterPostie.php in $wp_content_path");
16
- include_once ($wp_content_path . DIRECTORY_SEPARATOR . "filterPostie.php");
17
- }
18
-
19
- if (has_filter('postie_post')) {
20
- echo "Postie: filter 'postie_post' is depricated in favor of 'postie_post_before'";
21
- }
22
-
23
- $test_email = null;
24
- $config = config_Read();
25
- extract($config);
26
- if (!isset($maxemails)) {
27
- $maxemails = 0;
28
- }
29
-
30
- $emails = FetchMail($mail_server, $mail_server_port, $mail_userid, $mail_password, $input_protocol, $time_offset, $test_email, $delete_mail_after_processing, $maxemails, $email_tls);
31
- $message = 'Done.';
32
-
33
- EchoInfo(sprintf(__("There are %d messages to process", "postie"), count($emails)));
34
-
35
- if (function_exists('memory_get_usage')) {
36
- DebugEcho(__("memory at start of e-mail processing:") . memory_get_usage());
37
- }
38
-
39
- DebugDump($config);
40
-
41
- //loop through messages
42
- $message_number = 0;
43
- foreach ($emails as $email) {
44
- $message_number++;
45
- DebugEcho("$message_number: ------------------------------------");
46
- //sanity check to see if there is any info in the message
47
- if ($email == NULL) {
48
- $message = __('Dang, message is empty!', 'postie');
49
- EchoInfo("$message_number: $message");
50
- continue;
51
- } else if ($email == 'already read') {
52
- $message = __("Message is already marked 'read'.", 'postie');
53
- EchoInfo("$message_number: $message");
54
- continue;
55
- }
56
-
57
- $mimeDecodedEmail = DecodeMIMEMail($email);
58
-
59
- DebugEmailOutput($email, $mimeDecodedEmail);
60
-
61
- //Check poster to see if a valid person
62
- $poster = ValidatePoster($mimeDecodedEmail, $config);
63
- if (!empty($poster)) {
64
- PostEmail($poster, $mimeDecodedEmail, $config);
65
- } else {
66
- EchoInfo("Ignoring email - not authorized.");
67
- }
68
- flush();
69
- }
70
- EchoInfo("Mail fetch complete, $message_number emails");
71
-
72
- if (function_exists('memory_get_usage')) {
73
- DebugEcho("memory at end of e-mail processing:" . memory_get_usage());
74
- }
1
  <?php
2
+ http_response_code(403);
3
+ ?>
4
+ <html>
5
+ <head>
6
+ <title>Postie - Error</title>
7
+ </head>
8
+ <body>
9
+ This URL is no longer supported for forcing an email check please update your cron job to
10
+ access http://&lt;mysite&gt;/?postie=get-mail
11
+ </body>
12
+ </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
postie-functions.php CHANGED
@@ -1,7 +1,6 @@
1
  <?php
2
-
3
  /*
4
- $Id: postie-functions.php 964840 2014-08-12 22:42:50Z WayneAllen $
5
  */
6
 
7
  //to turn on debug output add the following line to wp-config.php
@@ -47,7 +46,7 @@ if (!function_exists('mb_str_replace')) {
47
 
48
  function postie_environment() {
49
  DebugEcho("Postie Version: " . POSTIE_VERSION);
50
- DebugEcho("WordPres Version: " . get_bloginfo('version'));
51
  DebugEcho("PHP Version: " . phpversion());
52
  DebugEcho("OS: " . php_uname());
53
  DebugEcho("Debug mode: " . (IsDebugMode() ? "On" : "Off"));
@@ -61,7 +60,7 @@ function postie_environment() {
61
  if (!isPostieInCorrectDirectory()) {
62
  EchoInfo("Warning! Postie expects to be in its own directory named postie.");
63
  } else {
64
- EchoInfo("Postie is in " . dirname(__FILE__));
65
  }
66
 
67
  if (defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON) {
@@ -1951,7 +1950,7 @@ function postie_handle_upload(&$file, $overrides = false, $time = null) {
1951
 
1952
  // Move the file to the uploads dir
1953
  $new_file = $uploads['path'] . "/$filename";
1954
-
1955
  //move_uploaded_file() will not work here
1956
  if (false === rename($file['tmp_name'], $new_file)) {
1957
  DebugEcho("upload: rename failed");
@@ -3181,13 +3180,6 @@ function config_ValidateSettings($in) {
3181
  return $out;
3182
  }
3183
 
3184
- /**
3185
- * registers the settings and the admin optionspage
3186
- */
3187
- function postie_admin_settings() {
3188
- register_setting('postie-settings', 'postie-settings', 'config_ValidateSettings');
3189
- }
3190
-
3191
  /**
3192
  * This function handles setting up the basic permissions
3193
  */
@@ -3293,3 +3285,168 @@ function DebugFiltersFor($hook = '') {
3293
  DebugEcho("Registered filters for $hook");
3294
  DebugDump($wp_filter[$hook]);
3295
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  <?php
 
2
  /*
3
+ $Id: postie-functions.php 993029 2014-09-19 05:01:52Z WayneAllen $
4
  */
5
 
6
  //to turn on debug output add the following line to wp-config.php
46
 
47
  function postie_environment() {
48
  DebugEcho("Postie Version: " . POSTIE_VERSION);
49
+ DebugEcho("Wordpress Version: " . get_bloginfo('version'));
50
  DebugEcho("PHP Version: " . phpversion());
51
  DebugEcho("OS: " . php_uname());
52
  DebugEcho("Debug mode: " . (IsDebugMode() ? "On" : "Off"));
60
  if (!isPostieInCorrectDirectory()) {
61
  EchoInfo("Warning! Postie expects to be in its own directory named postie.");
62
  } else {
63
+ EchoInfo("Postie is in " . plugin_dir_path(__FILE__));
64
  }
65
 
66
  if (defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON) {
1950
 
1951
  // Move the file to the uploads dir
1952
  $new_file = $uploads['path'] . "/$filename";
1953
+
1954
  //move_uploaded_file() will not work here
1955
  if (false === rename($file['tmp_name'], $new_file)) {
1956
  DebugEcho("upload: rename failed");
3180
  return $out;
3181
  }
3182
 
 
 
 
 
 
 
 
3183
  /**
3184
  * This function handles setting up the basic permissions
3185
  */
3285
  DebugEcho("Registered filters for $hook");
3286
  DebugDump($wp_filter[$hook]);
3287
  }
3288
+
3289
+ function postie_test_config() {
3290
+ $config = config_Read();
3291
+ extract($config);
3292
+ $title = __("Postie Diagnosis");
3293
+ $parent_file = 'options-general.php?page=postie/postie.php';
3294
+ get_currentuserinfo();
3295
+
3296
+ if (!current_user_can('manage_options')) {
3297
+ LogInfo("non-admin tried to set options");
3298
+ echo "<h2> Sorry only admin can run this file</h2>";
3299
+ exit();
3300
+ }
3301
+ ?>
3302
+ <div class="wrap">
3303
+ <h1>Postie Configuration Test</h1>
3304
+ <?php
3305
+ postie_environment();
3306
+ ?>
3307
+
3308
+ <h2>Clock Tests</h2>
3309
+ <p>This shows what time it would be if you posted right now</p>
3310
+ <?php
3311
+ $content = "";
3312
+ $data = filter_Delay($content, null, $config['time_offset']);
3313
+ EchoInfo("Post time: $data[0]");
3314
+ ?>
3315
+
3316
+ <h2>Connect to Mail Host</h2>
3317
+
3318
+ <?php
3319
+ if (!$mail_server || !$mail_server_port || !$mail_userid) {
3320
+ EchoInfo("FAIL - server settings not complete");
3321
+ } else {
3322
+ DebugEcho("checking");
3323
+ }
3324
+
3325
+ switch (strtolower($config["input_protocol"])) {
3326
+ case 'imap':
3327
+ case 'imap-ssl':
3328
+ case 'pop3-ssl':
3329
+ if (!HasIMAPSupport()) {
3330
+ EchoInfo("Sorry - you do not have IMAP php module installed - it is required for this mail setting.");
3331
+ } else {
3332
+ require_once("postieIMAP.php");
3333
+ $mail_server = &PostieIMAP::Factory($config["input_protocol"]);
3334
+ if ($email_tls) {
3335
+ $mail_server->TLSOn();
3336
+ }
3337
+ if (!$mail_server->connect($config["mail_server"], $config["mail_server_port"], $config["mail_userid"], $config["mail_password"])) {
3338
+ EchoInfo("Unable to connect. The server said:");
3339
+ EchoInfo($mail_server->error());
3340
+ } else {
3341
+ EchoInfo("Successful " . strtoupper($config['input_protocol']) . " connection on port {$config["mail_server_port"]}");
3342
+ EchoInfo("# of waiting messages: " . $mail_server->getNumberOfMessages());
3343
+ $mail_server->disconnect();
3344
+ }
3345
+ }
3346
+ break;
3347
+ case 'pop3':
3348
+ default:
3349
+ require_once(ABSPATH . WPINC . DIRECTORY_SEPARATOR . 'class-pop3.php');
3350
+ $pop3 = new POP3();
3351
+ if (defined('POSTIE_DEBUG')) {
3352
+ $pop3->DEBUG = POSTIE_DEBUG;
3353
+ }
3354
+ if (!$pop3->connect($config["mail_server"], $config["mail_server_port"])) {
3355
+ EchoInfo("Unable to connect. The server said:" . $pop3->ERROR);
3356
+ } else {
3357
+ EchoInfo("Sucessful " . strtoupper($config['input_protocol']) . " connection on port {$config["mail_server_port"]}");
3358
+ $msgs = $pop3->login($config["mail_userid"], $config["mail_password"]);
3359
+ if ($msgs === false) {
3360
+ //workaround for bug reported here Apr 12, 2013
3361
+ //https://sourceforge.net/tracker/?func=detail&atid=100311&aid=3610701&group_id=311
3362
+ //originally repoted here:
3363
+ //https://core.trac.wordpress.org/ticket/10587
3364
+ if (empty($pop3->ERROR)) {
3365
+ EchoInfo("No waiting messages");
3366
+ } else {
3367
+ EchoInfo("Unable to login. The server said:" . $pop3->ERROR);
3368
+ }
3369
+ } else {
3370
+ EchoInfo("# of waiting messages: $msgs");
3371
+ }
3372
+ $pop3->quit();
3373
+ }
3374
+ break;
3375
+ }
3376
+ ?>
3377
+ </div>
3378
+ <?php
3379
+ }
3380
+
3381
+ function postie_get_mail() {
3382
+ require_once (plugin_dir_path(__FILE__) . 'mimedecode.php');
3383
+ if (!function_exists('file_get_html')) {
3384
+ require_once (plugin_dir_path(__FILE__) . 'simple_html_dom.php');
3385
+ }
3386
+
3387
+ EchoInfo("Starting mail fetch");
3388
+ postie_environment();
3389
+ $wp_content_path = dirname(dirname(dirname(__FILE__)));
3390
+ DebugEcho("wp_content_path: $wp_content_path");
3391
+ if (file_exists($wp_content_path . DIRECTORY_SEPARATOR . "filterPostie.php")) {
3392
+ DebugEcho("found filterPostie.php in $wp_content_path");
3393
+ include_once ($wp_content_path . DIRECTORY_SEPARATOR . "filterPostie.php");
3394
+ }
3395
+
3396
+ if (has_filter('postie_post')) {
3397
+ echo "Postie: filter 'postie_post' is depricated in favor of 'postie_post_before'";
3398
+ }
3399
+
3400
+ $test_email = null;
3401
+ $config = config_Read();
3402
+ //extract($config);
3403
+ if (!array_key_exists('maxemails', $config)) {
3404
+ $config['maxemails'] = 0;
3405
+ }
3406
+
3407
+ $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']);
3408
+ $message = 'Done.';
3409
+
3410
+ EchoInfo(sprintf(__("There are %d messages to process", "postie"), count($emails)));
3411
+
3412
+ if (function_exists('memory_get_usage')) {
3413
+ DebugEcho(__("memory at start of e-mail processing:") . memory_get_usage());
3414
+ }
3415
+
3416
+ DebugDump($config);
3417
+
3418
+ //loop through messages
3419
+ $message_number = 0;
3420
+ foreach ($emails as $email) {
3421
+ $message_number++;
3422
+ DebugEcho("$message_number: ------------------------------------");
3423
+ //sanity check to see if there is any info in the message
3424
+ if ($email == NULL) {
3425
+ $message = __('Dang, message is empty!', 'postie');
3426
+ EchoInfo("$message_number: $message");
3427
+ continue;
3428
+ } else if ($email == 'already read') {
3429
+ $message = __("Message is already marked 'read'.", 'postie');
3430
+ EchoInfo("$message_number: $message");
3431
+ continue;
3432
+ }
3433
+
3434
+ $mimeDecodedEmail = DecodeMIMEMail($email);
3435
+
3436
+ DebugEmailOutput($email, $mimeDecodedEmail);
3437
+
3438
+ //Check poster to see if a valid person
3439
+ $poster = ValidatePoster($mimeDecodedEmail, $config);
3440
+ if (!empty($poster)) {
3441
+ PostEmail($poster, $mimeDecodedEmail, $config);
3442
+ } else {
3443
+ EchoInfo("Ignoring email - not authorized.");
3444
+ }
3445
+ flush();
3446
+ }
3447
+ EchoInfo("Mail fetch complete, $message_number emails");
3448
+
3449
+ if (function_exists('memory_get_usage')) {
3450
+ DebugEcho("memory at end of e-mail processing:" . memory_get_usage());
3451
+ }
3452
+ }
postie-wp-config.php DELETED
@@ -1,13 +0,0 @@
1
- <?php
2
-
3
- //support moving wp-config.php as described here http://codex.wordpress.org/Hardening_WordPress#Securing_wp-config.php
4
- $wp_config_path = dirname(dirname(dirname(dirname(__FILE__))));
5
- if (file_exists($wp_config_path . DIRECTORY_SEPARATOR . "wp-config.php")) {
6
- include_once($wp_config_path . DIRECTORY_SEPARATOR . "wp-config.php");
7
- } elseif (file_exists(dirname($wp_config_path) . DIRECTORY_SEPARATOR . "wp-config.php")) {
8
- include_once (dirname($wp_config_path)) . DIRECTORY_SEPARATOR . "wp-config.php";
9
- } elseif (file_exists('/usr/share/wordpress/wp-config.php')) {
10
- include_once('/usr/share/wordpress/wp-config.php');
11
- } else {
12
- die("wp-config.php could not be found.");
13
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
postie.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Signifigantly upgrades the posting by mail features of Word Press (See <a href='options-general.php?page=postie/postie.php'>Settings and options</a>) to configure your e-mail settings. See the <a href='http://wordpress.org/extend/plugins/postie/other_notes'>Readme</a> for usage. Visit the <a href='http://wordpress.org/support/plugin/postie'>postie forum</a> for support.
7
- Version: 1.5.24
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
@@ -27,39 +27,28 @@
27
  */
28
 
29
  /*
30
- $Id: postie.php 964840 2014-08-12 22:42:50Z WayneAllen $
31
  */
32
 
33
- define('POSTIE_VERSION', '1.5.24');
34
  define("POSTIE_ROOT", dirname(__FILE__));
35
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
36
 
37
  //register the hooks early in the page in case some method needs the result of one of them (i.e. cron_schedules)
38
  add_action('init', 'disable_kses_content', 20);
39
  add_action('check_postie_hook', 'check_postie');
 
 
 
40
 
41
  add_filter('whitelist_options', 'postie_whitelist');
42
  add_filter('cron_schedules', 'postie_more_reccurences');
 
43
 
44
  register_activation_hook(__FILE__, 'activate_postie');
45
  register_activation_hook(__FILE__, 'postie_cron');
46
  register_deactivation_hook(__FILE__, 'postie_decron');
47
 
48
- function postie_loadjs_add_page() {
49
- $postiepage = add_options_page('Postie', 'Postie', 'manage_options', POSTIE_ROOT . '/postie.php', 'postie_loadjs_options_page');
50
- add_action("admin_print_scripts-$postiepage", 'postie_loadjs_admin_head');
51
- }
52
-
53
- function postie_loadjs_options_page() {
54
- require_once POSTIE_ROOT . '/config_form.php';
55
- }
56
-
57
- function postie_loadjs_admin_head() {
58
- wp_enqueue_script('loadjs', plugins_url('js/simpleTabs.jquery.js', __FILE__));
59
- echo '<link type="text/css" rel="stylesheet" href="' . plugins_url('css/style.css', __FILE__) . "\"/>\n";
60
- echo '<link type="text/css" rel="stylesheet" href="' . plugins_url('css/simpleTabs.css', __FILE__) . "\"/>\n";
61
- }
62
-
63
  if (isset($_GET["postie_read_me"])) {
64
  include_once(ABSPATH . "wp-admin/admin.php");
65
  $title = __("Edit Plugins");
@@ -71,8 +60,6 @@ if (isset($_GET["postie_read_me"])) {
71
  //Add Menu Configuration
72
  if (is_admin()) {
73
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
74
- add_action('admin_init', 'postie_admin_settings');
75
- add_action('admin_menu', 'postie_loadjs_add_page');
76
  if (function_exists('load_plugin_textdomain')) {
77
 
78
  function postie_load_domain() {
@@ -85,6 +72,57 @@ if (is_admin()) {
85
  postie_warnings();
86
  }
87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
88
  /*
89
  * called by WP when activating the plugin
90
  * Note that you can't do any output during this funtion or activation
@@ -175,8 +213,8 @@ function postie_warnings() {
175
 
176
  add_action('admin_notices', 'postie_mbstring_warning');
177
  }
178
-
179
- $userdata = WP_User::get_data_by( 'login', $config['admin_username'] );
180
  if (!$userdata) {
181
 
182
  function postie_adminuser_warning() {
4
  Plugin Name: Postie
5
  Plugin URI: http://PostiePlugin.com/
6
  Description: Signifigantly upgrades the posting by mail features of Word Press (See <a href='options-general.php?page=postie/postie.php'>Settings and options</a>) to configure your e-mail settings. See the <a href='http://wordpress.org/extend/plugins/postie/other_notes'>Readme</a> for usage. Visit the <a href='http://wordpress.org/support/plugin/postie'>postie forum</a> for support.
7
+ Version: 1.6.0
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
27
  */
28
 
29
  /*
30
+ $Id: postie.php 993029 2014-09-19 05:01:52Z WayneAllen $
31
  */
32
 
33
+ define('POSTIE_VERSION', '1.6.0');
34
  define("POSTIE_ROOT", dirname(__FILE__));
35
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
36
 
37
  //register the hooks early in the page in case some method needs the result of one of them (i.e. cron_schedules)
38
  add_action('init', 'disable_kses_content', 20);
39
  add_action('check_postie_hook', 'check_postie');
40
+ add_action('parse_request', 'postie_parse_request');
41
+ add_action('admin_init', 'postie_admin_init');
42
+ add_action('admin_menu', 'postie_admin_menu');
43
 
44
  add_filter('whitelist_options', 'postie_whitelist');
45
  add_filter('cron_schedules', 'postie_more_reccurences');
46
+ add_filter('query_vars', 'postie_query_vars');
47
 
48
  register_activation_hook(__FILE__, 'activate_postie');
49
  register_activation_hook(__FILE__, 'postie_cron');
50
  register_deactivation_hook(__FILE__, 'postie_decron');
51
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  if (isset($_GET["postie_read_me"])) {
53
  include_once(ABSPATH . "wp-admin/admin.php");
54
  $title = __("Edit Plugins");
60
  //Add Menu Configuration
61
  if (is_admin()) {
62
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
 
 
63
  if (function_exists('load_plugin_textdomain')) {
64
 
65
  function postie_load_domain() {
72
  postie_warnings();
73
  }
74
 
75
+ //****************** functions *************************
76
+
77
+ function postie_query_vars($vars) {
78
+ $vars[] = 'postie';
79
+ return $vars;
80
+ }
81
+
82
+ function postie_parse_request($wp) {
83
+ if (array_key_exists('postie', $wp->query_vars)) {
84
+ require_once(plugin_dir_path(__FILE__) . "postie-functions.php");
85
+ switch ($wp->query_vars['postie']) {
86
+ case 'get-mail':
87
+ postie_get_mail();
88
+ die();
89
+ case 'test-config':
90
+ postie_test_config();
91
+ die();
92
+ default :
93
+ dir('Unknown option: ' . $wp->query_vars['postie']);
94
+ }
95
+ }
96
+ }
97
+
98
+ function postie_admin_init() {
99
+ wp_register_style('postie-style', plugins_url('css/style.css', __FILE__));
100
+ wp_register_style('postie-simpleTabs', plugins_url('css/simpleTabs.css', __FILE__));
101
+ register_setting('postie-settings', 'postie-settings', 'config_ValidateSettings');
102
+ }
103
+
104
+ function postie_admin_menu() {
105
+ $page = add_menu_page('Postie', 'Postie', 'manage_options', 'postie-settings', 'postie_loadjs_options_page');
106
+ add_action('admin_print_styles-' . $page, 'postie_admin_styles');
107
+ }
108
+
109
+ function postie_loadjs_options_page() {
110
+ require_once POSTIE_ROOT . '/config_form.php';
111
+ }
112
+
113
+ function postie_admin_page() {
114
+ if (!current_user_can('manage_options')) {
115
+ wp_die(__('You do not have sufficient permissions to access this page.'));
116
+ }
117
+ include 'config_form.php';
118
+ }
119
+
120
+ function postie_admin_styles() {
121
+ wp_enqueue_script('loadjs', plugins_url('js/simpleTabs.jquery.js', __FILE__));
122
+ wp_enqueue_style('postie-style');
123
+ wp_enqueue_style('postie-simpleTabs');
124
+ }
125
+
126
  /*
127
  * called by WP when activating the plugin
128
  * Note that you can't do any output during this funtion or activation
213
 
214
  add_action('admin_notices', 'postie_mbstring_warning');
215
  }
216
+
217
+ $userdata = WP_User::get_data_by('login', $config['admin_username']);
218
  if (!$userdata) {
219
 
220
  function postie_adminuser_warning() {
postie_test.php DELETED
@@ -1,93 +0,0 @@
1
- <?php
2
- // try to connect to server with different protocols/ and userids
3
- require_once (dirname(__FILE__) . DIRECTORY_SEPARATOR . 'postie-wp-config.php');
4
- require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
5
- require_once("postie-functions.php");
6
-
7
- $config = config_Read();
8
- extract($config);
9
- $title = __("Postie Diagnosis");
10
- $parent_file = 'options-general.php?page=postie/postie.php';
11
- get_currentuserinfo();
12
-
13
- if (!current_user_can('manage_options')) {
14
- LogInfo("non-admin tried to set options");
15
- echo "<h2> Sorry only admin can run this file</h2>";
16
- exit();
17
- }
18
- ?>
19
- <div class="wrap">
20
- <h1>Postie Configuration Test</h1>
21
- <?php
22
- postie_environment();
23
- ?>
24
-
25
- <h2>Clock Tests</h2>
26
- <p>This shows what time it would be if you posted right now</p>
27
- <?php
28
- $content = "";
29
- $data = filter_Delay($content, null, $config['time_offset']);
30
- EchoInfo("Post time: $data[0]");
31
- ?>
32
-
33
- <h2>Connect to Mail Host</h2>
34
-
35
- <?php
36
- if (!$mail_server || !$mail_server_port || !$mail_userid) {
37
- EchoInfo("FAIL - server settings not complete");
38
- } else {
39
- DebugEcho("checking");
40
- }
41
-
42
- switch (strtolower($config["input_protocol"])) {
43
- case 'imap':
44
- case 'imap-ssl':
45
- case 'pop3-ssl':
46
- if (!HasIMAPSupport()) {
47
- EchoInfo("Sorry - you do not have IMAP php module installed - it is required for this mail setting.");
48
- } else {
49
- require_once("postieIMAP.php");
50
- $mail_server = &PostieIMAP::Factory($config["input_protocol"]);
51
- if ($email_tls) {
52
- $mail_server->TLSOn();
53
- }
54
- if (!$mail_server->connect($config["mail_server"], $config["mail_server_port"], $config["mail_userid"], $config["mail_password"])) {
55
- EchoInfo("Unable to connect. The server said:");
56
- EchoInfo($mail_server->error());
57
- } else {
58
- EchoInfo("Successful " . strtoupper($config['input_protocol']) . " connection on port {$config["mail_server_port"]}");
59
- EchoInfo("# of waiting messages: " . $mail_server->getNumberOfMessages());
60
- $mail_server->disconnect();
61
- }
62
- }
63
- break;
64
- case 'pop3':
65
- default:
66
- require_once(ABSPATH . WPINC . DIRECTORY_SEPARATOR . 'class-pop3.php');
67
- $pop3 = new POP3();
68
- if (defined('POSTIE_DEBUG')) {
69
- $pop3->DEBUG = POSTIE_DEBUG;
70
- }
71
- if (!$pop3->connect($config["mail_server"], $config["mail_server_port"])) {
72
- EchoInfo("Unable to connect. The server said:" . $pop3->ERROR);
73
- } else {
74
- EchoInfo("Sucessful " . strtoupper($config['input_protocol']) . " connection on port {$config["mail_server_port"]}");
75
- $msgs = $pop3->login($config["mail_userid"], $config["mail_password"]);
76
- if ($msgs === false) {
77
- //workaround for bug reported here Apr 12, 2013
78
- //https://sourceforge.net/tracker/?func=detail&atid=100311&aid=3610701&group_id=311
79
- //originally repoted here:
80
- //https://core.trac.wordpress.org/ticket/10587
81
- if (empty($pop3->ERROR))
82
- EchoInfo("No waiting messages");
83
- else
84
- EchoInfo("Unable to login. The server said:" . $pop3->ERROR);
85
- } else {
86
- EchoInfo("# of waiting messages: $msgs");
87
- }
88
- $pop3->quit();
89
- }
90
- break;
91
- }
92
- ?>
93
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.html CHANGED
@@ -1,277 +1,7 @@
1
- <h3>Installation</h3>
2
- <ul>
3
- <li>Either:
4
-
5
- <ul>
6
- <li>Put the postie.zip file in wp-content/plugins/ and unzip it</li>
7
- </ul></li>
8
- <li>Or:
9
-
10
- <ul>
11
- <li>Use the automatic installer (WP 2.7+)</li>
12
- </ul></li>
13
- <li>Login to WordPress as an administrator</li>
14
- <li>Goto the Plugins tab in the WordPress Admin Site</li>
15
- <li>Activate "Postie"</li>
16
- <li>Goto to the "Settings" tab and click on the sub-tab "Postie" to configure it.</li>
17
- <li>Make sure you enter the mailserver information correctly, including the type
18
- of connection and the port number. Common port configurations:
19
-
20
- <ul>
21
- <li>pop3: 110 </li>
22
- <li>pop3-ssl: 995</li>
23
- <li>imap: 143</li>
24
- <li>imap-ssl: 993</li>
25
- </ul></li>
26
- <li>(Postie ignores the settings under Settings-&gt;Writing-&gt;Writing-by-Email)</li>
27
- </ul>
28
-
29
- <h4>Automating checking e-mail</h4>
30
-
31
- <p>WordPress cron (which Postie relies on) doesn't run unless a page is accessed on
32
- the site. So if you send an email, but nobody accesses the site for 3 days Postie
33
- won't be given the chance to fetch the email and publish the post.</p>
34
-
35
- <p>To ensure that Postie runs smoothly on a low or no volume site you need to ensure
36
- that a page gets hit (any page is fine). Use something like cron + curl on Linux
37
- or install curl on Windows and use the Scheduled Tasks control panel. If you are
38
- using a hosting company that doesn't allow you access to cron you can use a service
39
- like SetCronJob.</p>
40
-
41
- <p>By default, postie checks for new e-mail every 30 minutes. You can select from
42
- a number of different checking intervals in the settings page, under the
43
- Mailserver tab.</p>
44
-
45
- <h4>Forcing e-mail check</h4>
46
-
47
- <p>If you would prefer to have more fine-grained control of how postie checks
48
- for mail, you can also set up a crontab. This is for advanced users only.</p>
49
-
50
- <p>Setup a cronjob to pull down the get&#095;mail.php - note that every time you access
51
- get&#095;mail.php Postie will run - it is like clicking Run Postie on the Admin screen.</p>
52
-
53
- <h4>Linux</h4>
54
-
55
- <p>If your site runs on a UNIX/linux server, and you have shell access, you can
56
- enable mail checking using cron.</p>
57
-
58
- <p>Examples:</p>
59
-
60
- <p>*/5 * * * * /usr/bin/lynx --source <a href="http://blog.robfelty.com/wp-content/plugins/postie/get&#095;mail.php" rel="nofollow">http://blog.robfelty.com/wp-content/plugins/postie/get&#095;mail.php</a> &gt;/dev/null 2&gt;&amp;1</p>
61
-
62
- <p>This fetches the mail every five minutes with lynx</p>
63
-
64
- <p>*/10 * * * * /usr/bin/wget -O /dev/null <a href="http://blog.robfelty.com/wp-content/plugins/postie/get&#095;mail.php" rel="nofollow">http://blog.robfelty.com/wp-content/plugins/postie/get&#095;mail.php</a> &gt;/dev/null 2&gt;&amp;1</p>
65
-
66
- <p>This fetches the mail every ten minutes with wget</p>
67
-
68
- <h4>Windows</h4>
69
-
70
- <p>You will need to install <a href="http://gnuwin32.sourceforge.net/packages/wget.htm">wget</a> or <a href="http://curl.haxx.se/dlwiz/">curl</a>
71
- Then use the Task Scheduler control panel to call wget or cron.</p> <hr />
72
-
73
- <h3>Upgrade Notice</h3>
74
- <dl>
75
- <dt>1.5.14</dt>
76
- <dd>The postie_post filter has be deprecated in favor of postie_post_before.</dd>
77
- <dt>1.5.3</dt>
78
- <dd>Postie can now set the first image in an email to be the &quot;Featured&quot; image. There is a new setting &quot;Use First Image as Featured Image&quot; which is off by default.
79
- Postie now supports Use Transport Layer Security (TLS)</dd>
80
- <dt>1.5.0</dt>
81
- <dd>New filter postie_filter_email. Used to map &quot;from&quot; to any other email. Allows custom user mapping.</dd>
82
- <dt>1.4.41</dt>
83
- <dd>Post format is now supported. You can specify any of the WordPress supported post formats using the Post type syntax.
84
- Post status can now be specified using the status: tag.
85
- Post status setting was renamed to Default Post Status and moved to the Message tab.</dd>
86
- <dt>1.4.10</dt>
87
- <dd>All script, style and body tags are stripped from html emails.</dd>
88
- <dt>1.4.6</dt>
89
- <dd>Attachments are now processed in the order they were attached.</dd>
90
- </dl>
91
-
92
- <h3 id='Usage'>Usage</h3>
93
- <h4>Specifying Beginning and Ending of Post</h4>
94
-
95
- <ul>
96
- <li>If you put in :start - the message processing won't start until it sees that string.</li>
97
- <li>If you put in :end - the message processing will stop once it sees that string.</li>
98
- </ul>
99
-
100
- <h4>Post Status</h4>
101
-
102
- <ul>
103
- <li>Posts can have their status set to draft, publish, pending or private. This will override the Default Post Status set in the settings screen.
104
-
105
- <ul>
106
- <li>status: private</li>
107
- <li>status: draft</li>
108
- </ul></li>
109
- </ul>
110
-
111
- <h4>Post Date</h4>
112
-
113
- <ul>
114
- <li>Posts can have a specific publication date such as Apr 14, 2013. Relative dates like "tomorrow", "monday", "first day of next month" are also supported.
115
-
116
- <ul>
117
- <li>date: date</li>
118
- <li>date: date time</li>
119
- </ul></li>
120
- <li>Posts can be delayed by adding a line with delayXdXhXm where X is a number.
121
-
122
- <ul>
123
- <li>delay:1d - 1 day</li>
124
- <li>delay:1h - 1 hour</li>
125
- <li>delay:1m - 1 minute</li>
126
- <li>delay:1d2h4m - 1 day 2 hours 4m</li>
127
- </ul></li>
128
- </ul>
129
-
130
- <h4>Comment Control</h4>
131
-
132
- <ul>
133
- <li>By putting comments:X in your message you can control if comments are allowed
134
-
135
- <ul>
136
- <li>comments:0 - means closed</li>
137
- <li>comments:1 - means open</li>
138
- <li>comments:2 - means registered only</li>
139
- </ul></li>
140
- <li>Replying to an e-mail gets posted as a comment.
141
-
142
- <ul>
143
- <li>For example, you e-mailed a post with the subject line "foo".
144
- If you then send an e-mail with the subject line "Re: foo", it will
145
- get posted as a comment to the "foo" post. This works by the subject
146
- line, so if you have two posts with titles "foo", then the comment
147
- will get placed in the more recent post.</li>
148
- </ul></li>
149
- </ul>
150
-
151
- <h4>Post Excerpt</h4>
152
-
153
- <ul>
154
- <li>Custom excerpt
155
-
156
- <ul>
157
- <li>You can include a custom excerpt of an e-mail by putting it between
158
- :excerptstart and :excerptend</li>
159
- <li>You can include images in the excerpt by using the shortcode #eimg1#,
160
- #eimg2# etc.</li>
161
- </ul></li>
162
- </ul>
163
-
164
- <h4>Post type/format</h4>
165
-
166
- <p>You can specify the post type or format by including it as the first part of the subject followed by 2 forward slashes (//).
167
- E.g. aside//real subject</p>
168
-
169
- <h4>Categories</h4>
170
-
171
- <ul>
172
- <li>If you put a category name in the subject with a : it will be used
173
- as the category for the post</li>
174
- <li>If you put a category id number in the subject with a : it will
175
- be used as the category for the post</li>
176
- <li><p>If you put the first part of a category name it will be posted in
177
- the first category that the system finds that matches - so if you put</p>
178
-
179
- <p>Gen: New News</p>
180
-
181
- <p>The system will post that in General. Note you must turn on the "Match short category"
182
- setting for this to work (on by default).</p></li>
183
- <li><p>All of the above also applies if you put the category in brackets []</p></li>
184
- <li><p>Using [] or you can post to multiple categories at once</p>
185
-
186
- <p>Subject: [1] [Mo] [Br] My Subject</p>
187
-
188
- <p>On my blog it would post to General (Id 1), Moblog, and Brewing all at one time</p></li>
189
- <li><p>Using - or you can post to multiple categories at once</p>
190
-
191
- <p>Subject: -1- -Mo- -Br- My Subject</p>
192
-
193
- <p>On my blog it would post to General (Id 1), Moblog, and Brewing all at one time</p></li>
194
- </ul>
195
-
196
- <h4>Tags</h4>
197
-
198
- <ul>
199
- <li>You can add tags by adding a line in the body of the message like so:
200
- tags: foo, bar</li>
201
- <li>You can also set a default tag to be applied if no tags are included.</li>
202
- </ul>
203
-
204
- <h4>Image Handling</h4>
205
-
206
- <ul>
207
- <li>Allows you to attach images to your email and automatically post
208
- them to your blog.</li>
209
- <li>You can publish images in the text of your message by using #img1#
210
- #img2# - each one will be replaced with the HTML for the image
211
- you attached</li>
212
- <li><p>Captions - you can also add a caption like so:</p>
213
-
214
- <ul>
215
- <li>#img1 caption='foo'#</li>
216
- <li>#img2 caption='bar'#</li>
217
- </ul>
218
-
219
- <p>Or, if you use IPTC captions, this caption will be used (adding a caption
220
- in many photo editing programs (for example Picasa), will add an IPTC caption)</p>
221
-
222
- <p>Note that the images are processed in the order they are attached as of version
223
- 1.4.6.</p>
224
-
225
- <p>Note you can only use the #img# feature if your "Preferred Text Type" is set to "plain"</p></li>
226
- <li><p>Image templates
227
- Postie now uses the default wordpress image template, but you can specify a
228
- different one if you wish.</p>
229
-
230
- <p>You can also specify a custom image template. I use the following custom
231
- template:</p>
232
-
233
- <p><code>&lt;div class='imageframe alignleft'&gt;&lt;a href='{IMAGE}'&gt;&lt;img src="{THUMBNAIL}"
234
- alt="{CAPTION}" title="{CAPTION}"
235
- class="attachment" /&gt;&lt;/a&gt;&lt;div
236
- class='imagecaption'&gt;{CAPTION}&lt;/div&gt;&lt;/div&gt;</code></p>
237
-
238
- <ul>
239
- <li>{CAPTION} gets replaced with the caption you specified (if any)</li>
240
- <li>{FILELINK} gets replaced with the url to the media</li>
241
- <li>{FILENAME} gets replaced with the name of the attachment from the email</li>
242
- <li>{FULL} same as {FILELINK}</li>
243
- <li>{HEIGHT} gets replaced with the height of the photo</li>
244
- <li>{ID} gets replaced with the post id</li>
245
- <li>{IMAGE} same as {FILELINK}</li>
246
- <li>{LARGEHEIGHT} gets replaced with the height of a large image</li>
247
- <li>{LARGEWIDTH} gets replaced with the width of a large image</li>
248
- <li>{LARGE} gets replaced with the url to the large-sized image</li>
249
- <li>{MEDIUMHEIGHT} gets replaced with the height of a medium image</li>
250
- <li>{MEDIUMWIDTH} gets replaced with the width of a medium image</li>
251
- <li>{MEDIUM} gets replaced with the url to the medium-sized image</li>
252
- <li>{PAGELINK} gets replaced with the URL of the file in WordPress</li>
253
- <li>{RELFILENAME} gets replaced with the relative path to the full-size image</li>
254
- <li>{THUMBHEIGHT} gets replaced with the height of a thumbnail image</li>
255
- <li>{THUMB} gets replaced with the url to the thumbnail image</li>
256
- <li>{THUMBNAIL} same as {THUMB}</li>
257
- <li>{THUMBWIDTH} gets replaced with the width of a thumbnail image</li>
258
- <li>{TITLE} same as {FILENAME}</li>
259
- <li>{URL} same as {FILELINK}</li>
260
- <li>{WIDTH} gets replaced with width of the photo</li>
261
- <li>{ICON} insert the icon for the attachment (for non-audio/image/video attachments only)</li>
262
- </ul></li>
263
- </ul>
264
-
265
- <h4>Interoperability</h4>
266
-
267
- <ul>
268
- <li>If your mail client doesn't support setting the subject (nokia) you
269
- can do so by putting #your subject/title here# at the beginning of your message</li>
270
- <li>POP3,POP3-SSL,IMAP,IMAP-SSL now supported - last three require
271
- php-imap support</li>
272
- <li>The program understands enough about mime to not duplicate post
273
- if you send an HTML and plain text message</li>
274
- <li>Automatically confirms that you are installed correctly</li>
275
- </ul>
276
- <hr />
277
-
1
+ <html>
2
+ <head><title>302 Found</title></head>
3
+ <body bgcolor="white">
4
+ <center><h1>302 Found</h1></center>
5
+ <hr><center>nginx</center>
6
+ </body>
7
+ </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,26 +3,57 @@ Contributors: WayneAllen
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HPK99BJ88V4C2
4
  Author URI: http://allens-home.com/
5
  Plugin URI: http://PostiePlugin.com/
6
- Tags: e-mail, email
7
  Requires at least: 3.0
8
- Tested up to: 3.9.2
9
- Stable tag: 1.5.24
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
- Postie allows you to blog via e-mail, including many advanced features not found in WordPress's default post by e-mail feature.
14
 
15
  == Description ==
16
- Postie offers many advanced features for posting to your blog via e-mail,
17
  including the ability to assign categories by name, included pictures and
18
  videos, and automatically strip off signatures. It also has support for both
19
- imap and pop3, with the option for ssl with both. For usage notes, see the
20
  [other notes](other_notes) page
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  == Screenshots ==
23
 
24
- 1. Postie options (showing video and audio templates)
25
- == Installation ==
 
 
 
 
 
 
26
  * Either:
27
  * Put the postie.zip file in wp-content/plugins/ and unzip it
28
  * Or:
@@ -422,6 +453,11 @@ It is also possible to turn the WordPress cron off. Please make sure something l
422
  `define('DISABLE_WP_CRON', true);` is not in your wp-config.php file.
423
  == Upgrade Notice ==
424
 
 
 
 
 
 
425
  = 1.5.14 =
426
  The postie_post filter has be deprecated in favor of postie_post_before.
427
 
@@ -444,6 +480,11 @@ All script, style and body tags are stripped from html emails.
444
  Attachments are now processed in the order they were attached.
445
 
446
  == CHANGELOG ==
 
 
 
 
 
447
  = 1.5.24 (2014.08.12) =
448
  * Fix attachment renaming bug
449
  * Test with Wordpress 3.9.2
@@ -451,7 +492,7 @@ Attachments are now processed in the order they were attached.
451
  = 1.5.23 (2014.08.11) =
452
  * Remove PEAR/PEAR5 dependency which was causing errors on some systems
453
  * Call wp_handle_upload_prefilter before adding images to WP
454
- * Temporary new post is now draft status.
455
 
456
  = 1.5.22 (2014.06.10) =
457
  * Fix missing attachments for html messages
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=HPK99BJ88V4C2
4
  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.0
8
+ Tested up to: 4.0
9
+ Stable tag: 1.6.0
10
  License: GPLv2 or later
11
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
12
 
13
+ Postie allows you to create posts via e-mail, including many advanced features not found in WordPress's default Post by Email feature.
14
 
15
  == Description ==
16
+ Postie offers many advanced features for creating posts via e-mail,
17
  including the ability to assign categories by name, included pictures and
18
  videos, and automatically strip off signatures. It also has support for both
19
+ IMAP and POP3, with the option for ssl with both. For usage notes, see the
20
  [other notes](other_notes) page
21
 
22
+ More info at http://PostiePlugin.com/
23
+
24
+ = Features =
25
+ * Supports IMAP or POP3 servers
26
+ * SSL and TLS supported
27
+ * Control who gets to post via email
28
+ * Set defaults for category, status, post format, post type and tags.
29
+ * Set title, category, status, post format, post type, date, comment control and tags in email to override defaults.
30
+ * Specify post excerpt (including excerpt only images).
31
+ * Use plain text or HTML version of email.
32
+ * Remove headers and footers from email (useful for posting from a mailing list).
33
+ * Optionally send emails on post success/failure.
34
+ * Control the types of attachments that are allowed by file name (wildcards allowed) and MIME type.
35
+ * Optionally make the first image the featured image.
36
+ * Gallery support.
37
+ * Control image placement with plain text email.
38
+ * Templates for images so they look the way you want.
39
+ * Templates for videos.
40
+ * Templates for audio files.
41
+ * Templates for other attachments.
42
+ * Email replies become comments.
43
+
44
+ = Developers =
45
+ * Several filter hooks available for custom processing of emails.
46
+
47
  == Screenshots ==
48
 
49
+ 1. Postie server options
50
+ 2. Postie user options
51
+ 3. Postie message options
52
+ 4. More message options
53
+ 5. Even more message options
54
+ 6. Image options
55
+ 7. Video and Audio options
56
+ 8. Attachment options== Installation ==
57
  * Either:
58
  * Put the postie.zip file in wp-content/plugins/ and unzip it
59
  * Or:
453
  `define('DISABLE_WP_CRON', true);` is not in your wp-config.php file.
454
  == Upgrade Notice ==
455
 
456
+ = 1.6.0 =
457
+ Remote cron jobs need to update the URL used to kick off a manual email check. The new URL is http://<mysite>/?postie=get-mail
458
+ Accessing http://<mysite>/wp-content/plugins/postie/get_mail.php will now receive a 403 error and a message stating what the new URL should be.
459
+ The Postie menu is now at the main level rather than a Settings submenu.
460
+
461
  = 1.5.14 =
462
  The postie_post filter has be deprecated in favor of postie_post_before.
463
 
480
  Attachments are now processed in the order they were attached.
481
 
482
  == CHANGELOG ==
483
+ = 1.6.0 (2014.09.18) =
484
+ * Updated remote cron url to be more compatible with Wordpress
485
+ * The Postie menu has been moved out of the Settings menu to the top level
486
+ * Tested with Wordpress 4.0
487
+
488
  = 1.5.24 (2014.08.12) =
489
  * Fix attachment renaming bug
490
  * Test with Wordpress 3.9.2
492
  = 1.5.23 (2014.08.11) =
493
  * Remove PEAR/PEAR5 dependency which was causing errors on some systems
494
  * Call wp_handle_upload_prefilter before adding images to WP
495
+ * Temporary new post is now draft status
496
 
497
  = 1.5.22 (2014.06.10) =
498
  * Fix missing attachments for html messages