Wordpress: post via email using Postie

Internet
Author

Vinh Nguyen

Published

April 7, 2010

Wordpress's default "post by email" setting is pretty weak, mainly because it doesn't handle attachments (think posterous, among other things. Postie is quite powerful as it can handle different attachments and can handle my LaTeX and source code content. Note to self: use the development version!

Setting up is quite easy – you only need to install php5-imap to use imap with ssl. If the postie filters is activated, deactivate it or remove the two examples in there. This should remove the "(post via postie)" message in the subject line and "Bookmark this category" line in the gets appended to the beginning of the post.

Images

In the "Image" section in Postie's settings, set the Image Template to custom and set the template to blank. This way, if I want a gallery (wordpress feature since v2.5), I can add in this line in the post/email

[ gallery link="files" ]
## without the spaces in beginning and end, or use NextGen gallery
[ imagebrowser id=x ]
## need to know id of post

See this site for an overview. I can also use the NextGen gallery. When I have time, I want to hack postie so that the line gets appended by default if there are image attachments.

Embedding other sites' video and audio

Install Wordpress Video Plugin. See this site for the syntax.

Audio and Video attachments

Add "mpeg" in the audio list as mp3 files have that description. Install audio player and use the audio template

## audio
LeftSquareBracket audio:{FILELINK} RightSquareBracket
## video: simple_link
[[%7BFILELINK%7D][{FILENAME}]]

Audio player will play mp3 files. Video doesn't really play, but I don't plan to host any videos.

I will use posterous (my other blog) for more multimedia intensive blogging (since this is more of a technical blog).

Note: other attachments get attached as files!

Check email

Set up crontab -e:

*/10 * * * * /usr/bin/wget -O /dev/null http://my.server.com/wp-content/plugins/postie/get_mail.php >/dev/null 2>&1

for checking every 10 minutes.

Posting options

See this site for other options, such as categories, tags, delay, etc.

I will write a template email and use emacs to email and post. Weblogger is a little weak in that doesn't handle attachments and does not support tagging and categories (as of now).

Issues

  1. LaTeX: Need to use double backslashes to get things correctly.
  2. What else? Good enough for now.