electronic brain surgery since 2001

Mobile Blogging with DokuWiki

blog by email [photo by chidorian] Quite a few people use DokuWiki as their blogging engine. With Esther Brunner's Blog plugin nearly all features of a full blown blog are available to DokuWiki users. What was missing until now was a solution for mobile blogging (aka. running a moblog).

The simplest way to create DokuWiki pages (and thus blog entries) from a mobile device is to submit a page through email. Just type your blog entry, maybe attach an image and send it to a special address. Simple, eh? All we need now is a script to do it ;-)

Tadaa… I just built one: mail2page.

The script utilizes Manuel Lemos' MIME E-mail message parser class to parse a MIME (multipart) mail from STDIN and creates (or updates) a page using the body text. The page id has to be provided in the mail subject. Any attached files will be put in the media lib.

The script itself is very basic and does no authentication handling, so you want to make sure the email address you use to feed the script is kept secret and is reasonable complex (think of it as a password).

BTW. to pipe a mail into a script I used a maildropfilter. Just place a .mailfilter file in the homedir of a user with necessary write permissions, create an email alias for the user and check if the To: header matches to pipe it into the script:

if (/^To: verySecretungueassble@example\.com/)
    to "|$HOME/htdocs/bin/mail2page.php"
dokuwiki, moblog, mail
Similar posts: