Finally got around to writing some kind of doc for my mail posting script for WordPress. And I can therefore finally release it for the world to use and enjoy.
Actually, it is not technically a plugin, nor a hack, rather a standalone script that interfaces with WP to let you post entries to your blog via Email.
The name ‘keitai’ simply means ‘cell phone’ in Japanese… This script might as well have been called wp-cellphone-mail, I just liked the sound of ‘keitai’.
You can see a working demo on the right-hand side of this blog where it powers the “keitai log”. I have been using it for nearly a month now and it should be really stable albeit a tad complicated to set up (see below).
A quick roundabouts of the current features:
- works as a script executed on email reception (unlike WP’s built-in feature), which means you do not have to run a cron job and your posts appear instantaneously on your blog.
- handles jpeg pictures, will automatically create a thumbnail if they are too big and insert all necessary code in your post.
- can be run on a separate machine from your WP install: it uses xmlrpc to post the entry and can be set to use ftp to upload the picture files.
- can handle as many blogs and authors as you want. For each email account you can customize any aspect of the posts (image formatting, posting category etc). For example, you can easily set up the script to let 5 authors post to your blog with each one under a different category.
Now for the bad news:
This script is not trivial to set up. I have tried to include very detailed instructions that should supposedly be enough for even non technical-minded people. But hooking up the script to the email address can be somewhat complicated, and more importantly, it heavily depends on each hosting solution… which makes it quite hard to document.
Overall, you should be fine if you have ONE of the following:
- A “mail forward” feature in your server control panel (especially if the control panel in question uses the very common ‘cpanel’ solution) that lets you forward mails to a script (it usually does).
- a file entitled .procmailrc in your server root (meaning your mail server uses procmail).
- an Exim recipe file. However, you will need to know how to edit it (or look it up online, it’s not that hard), since I haven’t had time to write instructions for Exim.
If you think you have one of these, check out the full instructions in keitai-prefs.php for details on hooking the script and set it to use your blog. I tried to be as clear as possible, but if you run into any problems using them, please let me know. You do not have to be a programmer or know anything about PHP to use this script, however, it is probably a good idea to hold on for now if you are not comfortable editing a settings file manually and tweaking around your server settings.
Hopefully, next release (date very much unknown) will make a lot of this easier.
In the meantime, if you wanna use this wonderful little toy, just download the archive here. Unzip it, edit the keitai-prefs.php file, following the detailed instructions it contains and upload the whole lot to your server. The script doesn’t need to be inside your web root (somewhere inside the ‘www’ or ‘public_html’ folders) since it is not accessed through the web, actually, it is preferable if it is not.
Among the features I plan to add for an hypothetical 1.2 version are:
- Simpler interface to edit the script preferences
- POP3 support (if you want to use it like WP’s built in script).
- Password protection for posting.
- Access to post settings through email commands (e.g. you could choose the category to post it to).
- Support for more media types (movies, other graphic formats).
- Support for GPS coordinates.
- Full kanji support. Although this seems to be problem with the xmlrpc lib, the script has troubles with emails containing kanjis as of now. YMMV though.
- Support for EXIF data
- Better cleaning of content: remove unnecessary new lines etc. (allow textile parsing?)
as well as:
All that depending on the level of interest and the time I will be able to spend on it (not much for now). If you’d like to see other features or are having issue getting the script to work correctly, please let me know.