|MMS -> LJ gateway
||[Apr. 27th, 2003|04:03 pm]
LiveJournal Client Discussions
I've just finished writing a script meant for relaying cell phone MMS (Multimedia Messaging Service) messages to LiveJournal. It's meant to be a procmail plugin, and it's only useful if you can receive email on a shell account that has webspace associated with it. This is especially useful if you have a cameraphone; it is meant for posting a picture and some text.
It should be general enough to work with most service providers. I've only been able to test it with T-Mobile. If you want to play with it, it's available for download here.
I tried to download and I got an error reading the file.
2003-04-28 08:11 am (UTC)
I looked at the HTTP log, and right before you posted this I saw a successful request followed by two "Not-Modified" requests. I assume that was you.
If you try again and it doesn't work, I can send you the tarball through email, if you give me an address.
Thanks for scrtipt. Works great with AT&T Wireless service and Panasonic GU87 phone.
I did pair of small modifications to the script:
1. Use message subject as subject of the live journal post. My phone allows to send image with email, specifying subject
2. Use MD5 password to authenticate to live journal server. (slightly more secure)
Patch could be downloaded here
Another good thing to add, is using "charset" parameter of text/plain parts and convert whatever encoding found there to UTF8. This would allow to post messages in other languages.
2003-05-26 05:34 pm (UTC)
Thanks. The patch looks good overall (and I don't know why I didn't think of the subject line thing. :) I am wondering why you set decode_headers on the parser though; the perldoc page recommends against it.
If you have MIME encoded subject it would decode
it. However, with lack on charset conversion
it would would be useful only when charset was
UTF-8, US-ASII or ISO-8859-1. But it is better than
ot doing it at all.
I just read perldoc page. Maybe it is better to decode
just subject, not all headers. Looks like author first
decodes headers and then parse MIME message structure.
I think this is not correct implementation. Encoded quotation mark within field should not be treated by parser as part of syntax.
I did new revision of the patch.
In comparison with previous one I did:
1. Removed decode_headers call
2. Allow empty subject
3. Allows images of any format, not just jpeg. For example Panasonic GU87 allows to send PNG.
New patch could be downloaded here
. It replaces old one
and should be applied to the original script.
2003-06-01 04:14 am (UTC)
I played around a bit with trying to use non-ASCII characters in posts. It turns out that T-Mobile, at least, doesn't retain the character set information, so conversion to UTF-8 for posting to LJ would be kind of tricky.
Do you have any idea whether AT&T does the right thing with non-ASCII characters?
I guess it depends on the phone. My phone does not allow to select charset.
But your script is generic enough to use with any mail
client. Currently I am using it with phone, but I plan to use it with mail client on my PDA.
just tried the script (with latest patch) - i cannot get it work on 2 different machines. when i feed it a test message, i get:machine 1
Can't call method "head" on an undefined value at ./mmslj.pl line 187.
(on machine with perl v5.6.0, without reading a single line of input); error is on the line: my $to = $postmsg->head->get('From');
Can't call method "head" on an undefined value at /home/dk/bin/mmslj.pl line 70, chunk 1.
(on machine with perl 5.005_03),
code line is:check_auth($postmsg->head);
it looks like message format error... does it expect uucp-style "From " line?
found reason for the bug: directory ~/.mmslj/post must exist.
by the way, i have made
to this script
- mostly, allowed image-only postings (with subject), and added compatibility with verizon image gateway.
todo: create those directories automatically; perhaps manual (procmailrc/preferences/usage hints?)
I also noticed small limitation of the script: if you send MMS to several recepients, one of which is this script, the message get rejected. It is because it does strict comparison of TO address field.
Can anyone recommend a good free/low-cost server that I can use this script on?