How to...

How to post by mail and MMS to MovableType

Update, january 27. 2005:
The extremely kind PERL-guru Kenneth Raknes has helped me with some updates on the script. It is now uploaded and the link in this post points to the new version. See the file itself for a description of the bug fixes.

Original post:
I found an excellent script made by Yoz and Ben Milleare. This script makes a special blog for mobile posts, a moblog. What I wanted was simply the possibility to post to my regular blog by mail or MMS from my mobile phone and any E-mail client. I also wanted the possibility to post more than pictures. If I send a video file or a sound clip from my mobile phone, it is saved on the server and a link to the file is made in the post.

I also wanted it to support the special characters that we use in Norway.

So, I started editing the script, made some progress, but because of my lack of PERL-skills I soon needed some help. After some serious help from Trond Isaksen and Kenneth Raknes we got the script working the way I want. It is still messy, but it should not be too difficult to set up.

You can find the edited script here:
Link to edited mt-moblog script

You need to edit the following lines:
30 – insert the correct path to your MT-installation
45, 46, 47 – Insert the correct blog-id, author-id and category-id
81 – Insert the POP-server you will use
86 – Insert the POP user and password

You might want to edit these lines:
157, 158 – Width and height of thumbnail picture
206, 207 – HTML-code for the post itself

This is an example of a post that is made by mail:
Link to post done by mail

You need a folder to store the attached files, for my setup that is a folder called “images” in the same folder that the blog is kept. The script makes a new time stamped folder for each mail that comes in. All MIME-objects is saved in these folders.

This is the corresponding folder for the post mentioned above:
Folder with picture, thumbnail, text-file and HTML

Because I used Outlook to post this entry there is a HTML-file in the folder. The script always use the text-version of the mail.

Please feel free to use the script and contact me if you have problems.

Here is Ben’s original post about his version of the script:
MT-Moblog HOW-TO

And here is more information on posting to MT by email:
Problem: PostByEmail