Since I do not own an iPhone, and since Rogers Wireless in Canada has a weird way of handling image MMS messages, I spent a few hours this weekend creating a Python script to properly parse Rogers Wireless MMS emails. There are a few things Rogers does that makes sending MMS messages to TwitPic impossible:
- They attach a second “VeriSign” jpeg to the email which often gets chosen by TwitPic as the image to post.
- The subject of the email message from Rogers says something like, “You have received an MMS message from YOURCELLPHONENUMBER.” Most of us don’t like our cell phones numbers posted on Twitter.
The original subject of the MMS is actually included on a website linked to in the email.
So to compensate for these weird Rogers quirks my script will:
- Extract the proper JPEG from the email (it verifies that it didn’t take the VeriSign JPEG by comparing the JPEG to an MD5 hash of the VeriSign JPEG).
- Grabs the proper subject by going to the Rogers website linked to in the email.
- Uses the TwitPic API to upload the JPEG and message to TwitPic.
You can find the source code here. You will need a mail server that can pipe email messages to the script. If you have a Linux box with a public IP address, chances are you have everything you need. If there’s a lot of interest in this script, I will look into writing a tutorial on how to set it up, or if most people think this is too hard in general, then I may also look into getting it hosted on a server for everyone to use.
Please post a comment if you try the script out, if interests you at all, or if you want it hosted somewhere for you to use.
UPDATE: This script requires Python >= 2.5 because it uses email.feedparser. On some machine, you may need to call Python by using python25 to ensure version 2.5 is used. And if you’re using Ubuntu or Debian, install the python25 package.
Related posts:

