Subscribe to RSS feed

splitbrain.org - 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"
}
Tags:
dokuwiki,
moblog,
mail
Similar posts:
Posted on Thursday, March the 1st 2007 (3 years ago).

Comments?

1
Just a bug tip - via your feed this entry begins "Array Quite a few people use DokuWiki as their blogging engine."
2007-03-02 09:13:38
Harry Fuecks
2
Great :-D! That`s just what I was looking for regarding to my upcoming skiing holiday next week.
2007-03-02 18:39:31
3
Harry, that was a minor problem in the meta data renderer. Should be fixed as soon as I update the Wiki here, thanks for pointing it out.
2007-03-03 14:47:51
4
I've discovered dokuwiki last week and like it a lot. That the xhtml code validades was a reason for my to use it/test it. I've recommanded it to many in the meantime. I'd like to test this feature and tried to get it to work with procmail. I'm not a software engineer. Here's what I have now:

:0
* ^Subject:.*test
| /usr/local/bin/php /usr/home/myaccount/www/htdocs/dokuwiki/bin/mail2page.php

It looks like all email with the word "test" in the subject is now sent to mail2page.php. At least it is now error free (don't use ":0:") but it generate a page. Any idea how to pipe email to mail2page.php using procmail?
2007-03-04 17:45:20
Jacky
5
Uhm obviously "but it generate a page." should be "but it doesn't generate a page" -- otherwise I wouldn't have a problem.


Thanks.
2007-03-04 17:49:58
Jacky
6
I never used procmail, so I can't say anything about it. You should first make sure that the script itself works by piping a saved mail into it. There might be some dependencies on a recent devel version of DokuWiki (didn't test with the latest stable release).
2007-03-04 20:55:00
7
Thanks. I the meantime I've learned the pipe works, but somehow it doesn't arrive in the release version. If I create a php file with

<?php $fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)) {
 $email .= fread($fd, 1024);
}
fclose($fd);
?>
<?php mail("my@email.com", "return", "$email"); ?>

I receive the whole original message (header and body) in the body of the returned message.
2007-03-05 00:01:33
Jacky
8
Hi. This is a great feature. Are there any plans to turn it into a plugin? It would be great as for organisations trying to permanently archive and track email conversations.
2008-04-16 13:29:10
CAPTCHA

No HTML allowed. URLs will be linked with nofollow attribute. Whitespace is preserved.