The Postie plugin patch for Wordpress 2.5

Here’s a hack I did for Postie to work with Wordpress v2.5. The following fixes are present in this patch:

  1. Category specification in Subject - the database tables in v2.5 have changed drastically. I’ve updated Postie’s handling of categories to reflect those changes.
    Note: This will only work for Wordpress v2.5.
  2. exec(’chmod 0755′ . $file) - my hosting provider has disabled the exec function (for security reasons), so I’ve changed all calls to exec-chmod to php’s built-in chmod.
  3. missing ‘)’ in line 70 of postieIMAP.php file

Here are two files I’ve prepared to update your Postie installation:

  1. postie_patch_for_wp_25.diff - this is a diff file for applying a patch using the diff utility. It is in universal diff format. If you don’t know how to use diff, then choose the next file I’ve uploaded. :)
  2. postie_patch_for_wp_25.zip - just extract the files in this zip archive to your Postie plugin directory.

Note: this patch only works for Postie v1.1.1. I do not guarantee it to work for other versions of Postie.

Tags: , , , ,

11 Responses to “The Postie plugin patch for Wordpress 2.5”

  1. Neufeld Computer Services | Postie Hack with MiniPosts Says:

    […] add_post_meta($post_ID, ‘_mini_post’, 0); This goes as line 277 if you’re using this hack, or as line 276 if you’re using Postie version 1.1.1 unchanged. (I’m using the hack.) […]

  2. xurizaemon Says:

    would be happy to collab on bringing postie back to life. i’ve used it for a couple years, but it’s always had … issues.

    the patched version still doesn’t get categories right (for me) - is there additional magic?

  3. collector Says:

    no magic, just modifications to reflect the new changes in the database structure for the new version in wordpress, 2.5..

    which patch version are u referring to? the one i uploaded? it works on my site here.. :)

  4. yourcustomblog Says:

    i’ve setup WordPress 2.5 to post via email (works fine) but want to setup Postie to take advantage of enhanced features like posting to specific categories.

    I’ve been having problems…came across your patch so I upgraded to postie 1.1.1 and applied your patch. Still not working. Can anyone (please!) help?

    I followed the instructions from: http://codex.wordpress.org/Blog_by_Email

    Automated Browser Activation: add the following iframe code to the footer of your blog:

    I have created the directories wp-filez and wp-photos in the sandbox/wp-content folder and set chmod 777

    Response: 257 “/public_html/sandbox/wp-content” is your current location
    Command: SITE CHMOD 777 wp-filez
    Response: 200 Permissions changed on wp-filez
    Command: SITE CHMOD 777 wp-photos
    Response: 200 Permissions changed on wp-photos

    I am having several problems — when I run the configuration test I get:

    File Tests

    Test Result
    Photos Directory Exists Yes
    Files Directory Exists Yes
    Photos Directory Writable No
    Files Directory Writable No

    HOW can this BE? Why are these folders not writeable? I specified “recurse into all subdirectories and files”…

    also when I try to configure the Message Settings (under Postie Options) for:

    Default post by mail category

    though I have several categories, none appear in the drop down box.

    Finally, when I run the configuration I get the following errors under Image Test:

    Warning: imagejpeg() [function.imagejpeg]: Unable to open ‘/thumb.Test.png’ for writing: Permission denied in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php on line 1140

    Warning: imagecreatefromjpeg(/thumb.Test.png) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php(972) : eval()’d code on line 1

    Warning: imagerotate() expects parameter 1 to be resource, boolean given in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php on line 974

    Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php(979) : eval()’d code on line 1

    Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php on line 980

    Warning: imagejpeg() [function.imagejpeg]: Unable to open ‘/thumb.Test.jpg’ for writing: Permission denied in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php on line 1140

    Warning: imagecreatefromjpeg(/thumb.Test.jpg) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php(972) : eval()’d code on line 1

    Warning: imagerotate() expects parameter 1 to be resource, boolean given in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php on line 974

    Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php(979) : eval()’d code on line 1

    Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php on line 980

    Warning: imagejpeg() [function.imagejpeg]: Unable to open ‘/thumb.Test.gif’ for writing: Permission denied in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php on line 1140

    Warning: imagecreatefromjpeg(/thumb.Test.gif) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php(972) : eval()’d code on line 1

    Warning: imagerotate() expects parameter 1 to be resource, boolean given in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php on line 974

    Warning: imagejpeg(): supplied argument is not a valid Image resource in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php(979) : eval()’d code on line 1

    Warning: imagedestroy(): supplied argument is not a valid Image resource in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php on line 980

  5. yourcustomblog Says:

    i’ve setup WordPress 2.5 to post via email (works fine) but want to setup Postie to take advantage of enhanced features like posting to specific categories. Please help!

    I have created the directories wp-filez and wp-photos in the sandbox/wp-content folder and set chmod 777 (recurse into subdirectories and files)

    Response: 257 “/public_html/sandbox/wp-content” is your current location
    Command: SITE CHMOD 777 wp-filez
    Response: 200 Permissions changed on wp-filez
    Command: SITE CHMOD 777 wp-photos
    Response: 200 Permissions changed on wp-photos

    BUT when I run the configuration test I get:

    File Tests

    Test Result
    Photos Directory Exists Yes
    Files Directory Exists Yes
    Photos Directory Writable No
    Files Directory Writable No

    Image Test:

    Warning: imagejpeg() [function.imagejpeg]: Unable to open ‘/thumb.Test.png’ for writing: Permission denied in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php on line 1140

    Warning: imagecreatefromjpeg(/thumb.Test.png) [function.imagecreatefromjpeg]: failed to open stream: No such file or directory in /home/qiklife1/public_html/sandbox/wp-content/plugins/postie/postie-functions.php(972) : eval()’d code on line 1

  6. collector Says:

    The configuration test sometimes doesn’t work.
    You’re better off testing the functionality live, you are still in sandbox mode, anyway.

    For the errors posted, it seems your server is disabling execution of those functions: imagejpeg() and imagecreatefromjpeg(). Check with your sysad for permissions on those functions. It’s set in the disable_functions php ini config.

  7. John Freen Says:

    Thanks for providing this Blog.

  8. Donald Says:

    Works great! Thanks, I have been waiting for this to work since I switched to wordpress.

  9. Tommy Says:

    I am running postie 1.1.1 on WP 2.5.1 along with patch at the top of this page.

    I still cannot specify a default category in the postie settings. Am I missing something?

  10. collector Says:

    hi tommy,

    unfortunately, the default category configuration does not work.
    i haven’t gotten around to fixing it either.

  11. Tommy Says:

    No worries man, the category in the subject works fine….. Great Work!

Leave a Reply