?

Log in

No account? Create an account
MMS -> LJ gateway - LiveJournal Client Discussions [entries|archive|friends|userinfo]
LiveJournal Client Discussions

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

MMS -> LJ gateway [Apr. 27th, 2003|04:03 pm]
LiveJournal Client Discussions

lj_clients

[tla]
Hi all,

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.
linkReply

Comments:
[User Picture]From: vampyred
2003-04-28 03:07 am (UTC)
I tried to download and I got an error reading the file.
(Reply) (Thread)
[User Picture]From: tla
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.
(Reply) (Parent) (Thread)
[User Picture]From: vampyred
2003-04-28 11:59 am (UTC)

Re:

it worked thank you.
(Reply) (Parent) (Thread)
[User Picture]From: vzaliva
2003-05-25 08:39 pm (UTC)

thanks

Thanks for scrtipt. Works great with AT&T Wireless service and Panasonic GU87 phone.

(Reply) (Thread)
[User Picture]From: vzaliva
2003-05-26 05:07 pm (UTC)

patch

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.

(Reply) (Thread)
[User Picture]From: tla
2003-05-26 05:34 pm (UTC)

patch

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.
(Reply) (Parent) (Thread)
[User Picture]From: vzaliva
2003-05-26 07:27 pm (UTC)

patch

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.

(Reply) (Parent) (Thread)
[User Picture]From: vzaliva
2003-06-01 12:11 am (UTC)

patch

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.

(Reply) (Parent) (Thread)
[User Picture]From: tla
2003-06-01 04:14 am (UTC)

patch

Excellent, thanks.

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?
(Reply) (Parent) (Thread)
[User Picture]From: vzaliva
2003-06-01 11:02 am (UTC)

patch

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.

(Reply) (Parent) (Thread)
[User Picture]From: dk379
2003-07-18 01:00 am (UTC)
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');


machine 2
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);


any ideas?
it looks like message format error... does it expect uucp-style "From " line?
(Reply) (Parent) (Thread)
[User Picture]From: dk379
2003-07-18 03:26 am (UTC)
found reason for the bug: directory ~/.mmslj/post must exist.

by the way, i have made
some changes
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?)
(Reply) (Parent) (Thread)
[User Picture]From: vzaliva
2003-05-26 08:49 pm (UTC)

bug?

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.

(Reply) (Thread)
From: parallaxative
2003-12-09 09:32 am (UTC)
Can anyone recommend a good free/low-cost server that I can use this script on?
(Reply) (Thread)