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.
Please welcome a new member in the WP plugin & hack family: wp-keitaimail v. 1.0b!
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.
OR
OR
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.
Enjoy!

Sorry for the previous post – I had not set the path correctly – Now I am having a different problem altogether – have posted the error message below
—— pipe to |php /home/ashwinku/public_html/wp-keitaimail/wp-keitaimail.php
generated by ***@ashwinkumar.net ——
PHP: Error parsing /usr/local/lib/php.ini on line 272
Turck MMCache requires Zend Engine API version 20021010.
The Zend Engine API version 220040412 which is installed, is newer.
Contact Dmitry Stogov at http://turck-mmcache.sourceforge.net for a later version of Turck MMCache.
Content-type: text/html
X-Powered-By: PHP/5.0.3
Warning: main(/home/ashwinku/public_html/blog/wp-includes/class-xmlrpc.php) [function.main]: failed to open stream: No such file or directory in /home/ashwinku/public_html/wp-keitaimail/wp-keitaimail.php on line 31
Fatal error: main() [function.require]: Failed opening required ‘/home/ashwinku/public_html/blog/wp-includes/class-xmlrpc.php’ (include_path=’/home/ashwinku/public_html/wp-keitaimail/:.:/usr/lib/php:/usr/local/lib/php’) in /home/ashwinku/public_html/wp-keitaimail/wp-keitaimail.php on line 31
—— This is a copy of the message, including all the headers. ——
Hi. I love this program.
Let me leave some information for qmail users.
-go to the root directory and find a .qmail-accountname file. Edit it like this,
./.panel/users/*youre-mailaccountname*/
|/usr/local/bin/php /home/*yourdomein*/public_html/*yourdirectry*/wp-keitaimail/wp-keitaimail.php
Hi, Dr. Dave.
If you don’t mind, may I ask how to set up the latest updated pictures on the sidebar like your blog?
I just like to show several thumbnaills and link to the post that has the picture.
Gogh:
Magic of PHP… Hasn’t got anything to do with wp-keitai-mail, all custom PHP code that fetches the posts and cull them in this sort… When I have a sec, I might release such a theme one day… don’t hold your breath though (bit busy these days).
Hi, Dr. Dave.
Is it possible to post images as excerpt via keitai? I mean I like to put an attached image into the excerpt form.
The reason is that there is a plugin that generates thumbails from excerpt fields and display them randomly.
If it takes a lot of work for you, please never mind.
Cool script!
A nice feature would be to be able to call the script using Cron, and it would poll a specified POP account for mail and insert into the blog.
That would make the script much easier to implement for people without an own mail server.
Great job though!
Has anyone used this successfully with PHP5? I seem to be hitting a bug in mimedecode.php that causes the script to throw:
“Fatal error: Using $this when not in object context”
It looks like this is fixed in mimedecode.php 1.40 or greater but I’m still not having luck. If anyone has suggestions I’d be appreciative.
I found a solution
It looks like the syntax for calling mimedecode.php has changed in PHP 5.x, so a slight tweek to the wp-keitaimail.php was all that was needed to get it working again.
I’ll drop Dr. Dave an email with the fix.
I installed the script and sent a few messages – it works nice
but I’ve got a problem with Polish characters such as ó ę ź ć etc. There are some incorrect letters displayed instead. I tried setting up UTF-8 and some other encodings in the Thunderbird, but it didn’t help. Is there any solution for this?
Have probs. when I try put pics by mms! Just don’t publish thoses pictures anyone?
What is the exact command line I have to use, while connected through SSH to my acount, to forward an e-mail address (example at exampledomain dot com) to a file in my hosting account exampledomain.com/wpblog/content/file.php
Thanks in advance.
Juanfer, there’s no way for any of us to know what the exact command line you have to use is. Please contact your hosting provider for assistance.
Hello,
How can we improve the script to manage category… I would like usage like
subject of the mail : [category]Title of the article
mail : article
idea?
Pascal
Modified e-mail to blog.
I’ve modified Dr. Dave’s “WP-keitai-mail Plugin” to work with b2evo (originally it is made for WordPress blog system ).
It was simple – just had to change the format that the XML data was sent in.
The result, I have e-mail-to-blog functionality…
Problems with WordPress and MySQL 4.1
I’ve stopped using Blogger and have been fighting with the installation of WordPress, it’s open source php blogging software and most importantly it has a community around it.
So anyway, it turns out that it won’t install with MySQL 4.1 but it’s…
wp keitai mail – ftp modifications
Since I have my mail server running on a different server, I rely on the FTP features of the script, which needed some tweaking…
resize images to fit in the sidebar… [UPDATE] Found one! Thanks to Dr. Dave’s Keitai Mail script (heavily modified to work on a Windows server an [...]
WP cool plugin list wpPaginate: make a nice pagination WP-Mail: WP-keitai-mail Plugin: interfaces with WP to let you post entries to yo [...]
s! As you can see from the post below, I can now blog-via-email. I’m using the Keitai plugin to do it, and it works much better than the built-in [...]
WordPress Plugins
I’ve finally got around to doing a list of the plugins I’ve installed for WordPress.
The WordPress Plugin Database, with a full list of WordPress Plugins can be found here.
I personally had no problem installing any of them, so if you have had …
[...] 5
Posted by Dann under General
I spent a little time today messing around with Dr. Dave’s Keitai Mail Plugin. It didn’t work [...]
[...] t at the moment). Actually, I made a whole plugin to do that (and more), it’s there: Keitai Mail Plugin probably other stuff as I come across it… [...]
[...] it seems like I will have to do something with what is available. I have been playing with this plugin for a couple of days. But I am unable to forward the em [...]
[...] Well here it is my modifications to Phone2WP to have the thumbnail functionality of Keitai Mail with a few other little tweaks. To download click here [...]
[...] I need to hack wp-keitaimail to work with wordpress 1.3 as it seems the WP 1.3 uses a newer XML-PRC library, Incutio XML-RPC Library IXR [...]
[...] Jahaa, het is zo ver, ik ga lekker een weekje op vakantie en aangezien ik te lui ben geweest om een plugin als wp-ketai-mail te installeren, gaan jullie een weekje niets van mij te horen krijgen. Eigenlijk maar goed ook. Hebben jullie ook een weekje vakantie
Tot over een week! [...]
[...] I use Dr. Dave’s wp-keitai-mail script for my moblog postings which works great; however, it depends on some older XMLRPC files from WordPress 1.2 which unfortunately are vulnerable to remote code execution that has recently been exploited by a worm making its way around the Internet. It looks like Dr. Dave has lost interest in updating it and trying to rewrite it to use the new WP 1.5 XMLRPC libraries is non-trivial. [...]
[...] keitaimail, seems to be more along the lines of what I had in mind (redirecting mails to a script). Unfortunately it’s a php script, if only I could run php at shell all would be coool (yes, with 4 os) [...]
[...] keitai-mail, seems to be more along the lines of what I had in mind (redirecting mails to a script). Unfortunately I can’t get it to work properly, there are issues with ‘class-xmlrpc’ and it ignores both uppercase “Content-transfer-encoding : BASE64″ (not base64, which my phone is sending) and all attachments from a different phone I’ve been using. More likely down to problems in the accompanying mimedecode.php [...]
[...] Dr Dave » Blog Archive » WP-keitai-mail Plugin v. 1.0 Please welcome a new member in the WP plugin & hack family: wp-keitaimail v. 1.0b! 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 ‘keita (tags: wordpress plugin) [...]
Moblogging Redux
Ever since I converted my blog over to WordPress I have been at a loss for a good moblogging solution. In the past I had been using a script found at Tokyo Tidbits which worked well and could be called easily from procmail. Unfortunately once I had con…
[...] Last month I finally got around to updating to PHP5 which had the unfortunate side effect of breaking Dr. Dave’s excellent wp-keitai-mail script. After upgrading it would throw the following error: [...]
[...] The original version of this (by Ryan Duff) can be found here. A modified version to have the thumbnail functionality of Keitai Mail with a few other little tweaks can be found here. A friend of mine has further patched it up for me because it was letting the footer images through (even though it isn’t supposed too). This revision has only been tested on T-Mobile carrier. If you want it, download it here… [...]
[...] Ciao, quello che vi propongo stasera è un articolo leggermente più tecnico del solito, ma a mio avviso interessante e che riguarda un servizio che ho deciso di aggiungere al blog proprio in questi ultimi giorni.Come avrete letto ieri nei commenti miei e di Dromed ( ), ho pensato che sarebbe stato simpatico se avessi avuto la possibilità di aggiornare il blog anche in movimento, via email ma anche via mms, magari inserendo anche qualche foto. Da questa idea mi è venuta voglia di provare a rendere mobile questo blog e ho aggiunto un plugin che mi permette di fare moblogging. Ciò non significa che da ora in poi mi vedrete sempre postare dal cellulare, ma che, qualora mi allontanassi per qualche giorno, avreste comunque mie notizie corredate di immagini (che c**o eh?). E siccome per aggiungere il moblog ho dovuto superare qualche ostacolo facendo prove e chiedendo consigli perché in rete non si trovano grossi tutorial, vi dico quale soluzione ho adottato io e quali altre alternative potrebbero esserci per chi fa uso di WordPress con Hosting su Aruba (nel mio caso Hosting Linux). Di per sé, WordPress mette già a disposizione dell’utente la possibilità di inserire post “in movimento”, ma con qualche limitazione. Prima di accorgermi che esistevano dei plugins, come Postie, che aggiungevano funzionalità a quelle di default, mi è caduto l’occhio su quella che sembrava essere una buona soluzione: WP-keitai-mail. Mi piaceva perché dava l’impressione di gestire bene le immagini e non aveva la necessità di impostare un cronjob per chiamare periodicamente il file addetto alla lettura e pubblicazione delle email ricevute. L’unico problema è che su Aruba non è possibile né inoltrare direttamente le email ad uno script, né mettere le mani sul file .procmailrc. E’ sempre possibile, però, creare uno script php che accede alla casella, legge le email e le inoltra allo script wp-keitaimail.php.Vagando per wp-plugins.net mi ero soffermato su WP-MailBlog che mi sembrava unire completezza e semplicità sotto uno stesso prodotto. L’ho subito testato e ho riscontrato due problemi: l’impossibilità di creare un cronjob e l’incompatibilità del fatto di considerare come testo del post ciò che è scritto fra i simboli #, in quanto gli mms di Vodafone arrivano come email tutte colorate e il testo pubblicato non era nient’altro che codice HTML contenuto fra i primi due colori che si incontravano. Mi è bastato modificare il plugin sostituendo il carattere # con un altro che, sicuramente, non si trova utilizzato in HTML e ho risolto, mentre per la questione cron è stato utilissimo il consiglio di Krosis di usare EasyMonitor: in questo modo sono riuscito a far controllare la posta in automatico ogni 15 minuti inserendo come indirizzo da monitorare quello della pagina.php preposta al servizio.Nella speranza di non avervi liofilizzato le balle con questo post, ci risentiamo alla prossima puntata. Avrò in serbo qualche altra novità o notizia sconvolgente? [...]
[...] Dr Dave » Blog Archive » WP-keitai-mail Plugin v. 1.0 ケータイから投稿 [...]
[...] http://unknowngenius.com/blog/archives/2004/08/23/wp-keitai-mail-plugin-v-10/ [...]
[...] WP-keitai-mail Plugin v. 1.0 [...]
[...] guys and gals, Here is a test of <a href=“http://unknowngenius.com/blog/archives/2004/08/23/wp-keitai-mail-plugin-v-10/”>WP-keitai-mail Plugin v. [...]