Postie - Version 1.6.17

Version Description

(2015-03-28) = * Add a setting to attempt a user login based on the from address of the email if a matching Wordpress user exists.

Download this release

Release Info

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

Code changes from version 1.6.16 to 1.6.17

Files changed (7) hide show
  1. config_form.php +2 -1
  2. deploy/deploy.sh +4 -0
  3. docs/Changes.txt +3 -0
  4. docs/Postie.txt +57 -57
  5. postie-functions.php +12 -10
  6. postie.php +3 -3
  7. readme.txt +61 -58
config_form.php CHANGED
@@ -249,6 +249,7 @@
249
  <table class='form-table'>
250
 
251
  <?php echo BuildBooleanSelect(__("Allow Anyone To Post Via Email", "postie"), "postie-settings[turn_authorization_off]", $turn_authorization_off, __("Changing this to yes <b style='color: red'>is not recommended</b> - anything that gets sent in will automatically be posted.", "postie")); ?>
 
252
  <tr>
253
  <th scope="row">
254
  <?php _e('Roles That Can Post', 'postie') ?><br />
@@ -412,7 +413,7 @@
412
  </td>
413
  </tr>
414
 
415
- <?php echo BuildBooleanSelect(__("Treat Replies As", "postie"), "postie-settings[reply_as_comment]", $reply_as_comment, "", array("comments","new posts")); ?>
416
  <?php echo BuildBooleanSelect(__("Forward Rejected Mail", "postie"), "postie-settings[forward_rejected_mail]", $forward_rejected_mail); ?>
417
  <?php echo BuildBooleanSelect(__("Allow Subject In Mail", "postie"), "postie-settings[allow_subject_in_mail]", $allow_subject_in_mail, "Enclose the subject between '#' on the very first line. E.g. #this is my subject#"); ?>
418
  <?php echo BuildBooleanSelect(__("Allow HTML In Mail Subject", "postie"), "postie-settings[allow_html_in_subject]", $allow_html_in_subject); ?>
249
  <table class='form-table'>
250
 
251
  <?php echo BuildBooleanSelect(__("Allow Anyone To Post Via Email", "postie"), "postie-settings[turn_authorization_off]", $turn_authorization_off, __("Changing this to yes <b style='color: red'>is not recommended</b> - anything that gets sent in will automatically be posted.", "postie")); ?>
252
+ <?php echo BuildBooleanSelect(__("Force User Login", "postie"), "postie-settings[force_user_login]", $force_user_login, __("Changing this to yes will cause Postie to try and login as the 'from' user if they exist. This should be set to 'Yes' if you use custom taxonomies in the subject line.", "postie")); ?>
253
  <tr>
254
  <th scope="row">
255
  <?php _e('Roles That Can Post', 'postie') ?><br />
413
  </td>
414
  </tr>
415
 
416
+ <?php echo BuildBooleanSelect(__("Treat Replies As", "postie"), "postie-settings[reply_as_comment]", $reply_as_comment, "", array("comments", "new posts")); ?>
417
  <?php echo BuildBooleanSelect(__("Forward Rejected Mail", "postie"), "postie-settings[forward_rejected_mail]", $forward_rejected_mail); ?>
418
  <?php echo BuildBooleanSelect(__("Allow Subject In Mail", "postie"), "postie-settings[allow_subject_in_mail]", $allow_subject_in_mail, "Enclose the subject between '#' on the very first line. E.g. #this is my subject#"); ?>
419
  <?php echo BuildBooleanSelect(__("Allow HTML In Mail Subject", "postie"), "postie-settings[allow_html_in_subject]", $allow_html_in_subject); ?>
deploy/deploy.sh ADDED
@@ -0,0 +1,4 @@
 
 
 
 
1
+ cd ..
2
+ echo Create readme.txt
3
+ cat docs/Postie.txt docs/Installation.txt docs/Usage.txt docs/FAQ.txt docs/Changes.txt > readme.txt
4
+ cd deploy
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.6.16 (2015-03-17) =
31
  * If using the #img# feature and you supply a caption it will be added to the attachment's alt text.
32
 
27
  Attachments are now processed in the order they were attached.
28
 
29
  == CHANGELOG ==
30
+ = 1.6.17 (2015-03-28) =
31
+ * Add a setting to attempt a user login based on the from address of the email if a matching Wordpress user exists.
32
+
33
  = 1.6.16 (2015-03-17) =
34
  * If using the #img# feature and you supply a caption it will be added to the attachment's alt text.
35
 
docs/Postie.txt CHANGED
@@ -1,57 +1,57 @@
1
- === Postie ===
2
- 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, post-by-email
7
- Requires at least: 3.0
8
- Tested up to: 4.1.1
9
- Stable tag: 1.6.16
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 email, 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 by email,
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
57
-
1
+ === Postie ===
2
+ 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, post-by-email
7
+ Requires at least: 3.3.0
8
+ Tested up to: 4.1.1
9
+ Stable tag: 1.6.17
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 email, 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 by email,
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
57
+
postie-functions.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /*
3
- $Id: postie-functions.php 1114943 2015-03-18 00:10:27Z WayneAllen $
4
  */
5
 
6
  //to turn on debug output add the following line to wp-config.php
@@ -1449,14 +1449,15 @@ function ValidatePoster(&$mimeDecodedEmail, $config) {
1449
  }
1450
 
1451
  //actually log in as the user
1452
- $user = get_user_by('id', $poster);
1453
- if ($user) {
1454
- DebugEcho("logging in as {$user->user_login}");
1455
- wp_set_current_user($poster);
1456
- //wp_set_auth_cookie($poster);
1457
- do_action('wp_login', $user->user_login);
 
 
1458
  }
1459
-
1460
  return $poster;
1461
  }
1462
 
@@ -2514,7 +2515,7 @@ function filter_ReplaceImagePlaceHolders(&$content, $attachments, $config, $post
2514
  $caption = substr($caption, 1, strlen($caption) - 2);
2515
  }
2516
  DebugEcho("caption: $caption");
2517
-
2518
  DebugEcho("Adding alt text to image {$images[$i]->ID}");
2519
  update_post_meta($images[$i]->ID, '_wp_attachment_image_alt', $caption);
2520
 
@@ -2972,7 +2973,8 @@ function config_GetDefaults() {
2972
  'generaltemplate' => $postie_default,
2973
  'selected_generaltemplate' => 'postie_default',
2974
  'generate_thumbnails' => true,
2975
- 'reply_as_comment' => true
 
2976
  );
2977
  }
2978
 
1
  <?php
2
  /*
3
+ $Id: postie-functions.php 1122894 2015-03-28 22:13:56Z WayneAllen $
4
  */
5
 
6
  //to turn on debug output add the following line to wp-config.php
1449
  }
1450
 
1451
  //actually log in as the user
1452
+ if ($config['force_user_login'] == true) {
1453
+ $user = get_user_by('id', $poster);
1454
+ if ($user) {
1455
+ DebugEcho("logging in as {$user->user_login}");
1456
+ wp_set_current_user($poster);
1457
+ //wp_set_auth_cookie($poster);
1458
+ do_action('wp_login', $user->user_login);
1459
+ }
1460
  }
 
1461
  return $poster;
1462
  }
1463
 
2515
  $caption = substr($caption, 1, strlen($caption) - 2);
2516
  }
2517
  DebugEcho("caption: $caption");
2518
+
2519
  DebugEcho("Adding alt text to image {$images[$i]->ID}");
2520
  update_post_meta($images[$i]->ID, '_wp_attachment_image_alt', $caption);
2521
 
2973
  'generaltemplate' => $postie_default,
2974
  'selected_generaltemplate' => 'postie_default',
2975
  'generate_thumbnails' => true,
2976
+ 'reply_as_comment' => true,
2977
+ 'force_user_login' => false
2978
  );
2979
  }
2980
 
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.6.16
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
@@ -27,11 +27,11 @@
27
  */
28
 
29
  /*
30
- $Id: postie.php 1114943 2015-03-18 00:10:27Z WayneAllen $
31
  */
32
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
33
 
34
- define('POSTIE_VERSION', '1.6.16');
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.6.17
8
  Author: Wayne Allen
9
  Author URI: http://allens-home.com/
10
  License: GPL2
27
  */
28
 
29
  /*
30
+ $Id: postie.php 1122898 2015-03-28 22:23:05Z WayneAllen $
31
  */
32
  require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "postie-functions.php");
33
 
34
+ define('POSTIE_VERSION', '1.6.17');
35
  define("POSTIE_ROOT", dirname(__FILE__));
36
  define("POSTIE_URL", WP_PLUGIN_URL . '/' . basename(dirname(__FILE__)));
37
 
readme.txt CHANGED
@@ -1,60 +1,60 @@
1
- === Postie ===
2
- 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, post-by-email
7
- Requires at least: 3.0
8
- Tested up to: 4.1.1
9
- Stable tag: 1.6.16
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 email, 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 by email,
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
57
-
58
  == Installation ==
59
  * Install Postie either via the WordPress.org plugin directory, or by uploading the files to your server.
60
  * Activate Postie through the Plugins menu in WordPress.
@@ -234,6 +234,9 @@ 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.16 (2015-03-17) =
238
  * If using the #img# feature and you supply a caption it will be added to the attachment's alt text.
239
 
@@ -1173,4 +1176,4 @@ plugin. And the rest is history :)
1173
  * Cleaned up some pear stuff in install
1174
  *
1175
  = 0.1 - 2004-06 =
1176
- * First release
1
+ === Postie ===
2
+ 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, post-by-email
7
+ Requires at least: 3.3.0
8
+ Tested up to: 4.1.1
9
+ Stable tag: 1.6.17
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 email, 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 by email,
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
57
+
58
  == Installation ==
59
  * Install Postie either via the WordPress.org plugin directory, or by uploading the files to your server.
60
  * Activate Postie through the Plugins menu in WordPress.
234
  Attachments are now processed in the order they were attached.
235
 
236
  == CHANGELOG ==
237
+ = 1.6.17 (2015-03-28) =
238
+ * Add a setting to attempt a user login based on the from address of the email if a matching Wordpress user exists.
239
+
240
  = 1.6.16 (2015-03-17) =
241
  * If using the #img# feature and you supply a caption it will be added to the attachment's alt text.
242
 
1176
  * Cleaned up some pear stuff in install
1177
  *
1178
  = 0.1 - 2004-06 =
1179
+ * First release