I've recently gotten myself into the situation where I want people in Sweden to be able to send me SMS from Sweden not paying more than their usual local rate and have their messages end up on my phone with no extra charge.
I'm sure that if anyway at AT&T sees this they're going to get furious about it but hey, hackers will always be around doing stuff like this, adopt to the new technology instead.
Either way, starting to look into this problem I was thinking about a couple of SMS projects I've done a couple of years back, unfortunately all of these were payed services meaning that if I were to receive any message the sender would pay a minimum of 5 SEK ($0.5) which kinda kills the idea of the project. After poking around with colleagues someone gave me a tip about Ballou that has SMS services.
So I registred and looked around in the FAQ to figure out how to get things working, I expected there to be an option to have a prefix in an SMS followed by the message which would be sent to a 5-digit number or similar but I got a nice surprise, upon request you'll be assigned a dedicated number for no extra cost.
Obviously I would meet some more issues around this, Ballou does have an email forwarding service so I figured I should try sending it to AT&T's mail-to-SMS service, unfortunately it turned out that Ballou included a lot more information than I needed for this setup. When receiving an email it is formatted like:
And yeah that's HTML being sent as well. I could probably see myself making use of this extra data in another project but for this the only thing I wanted to have was the actual message, given the restricted amount of people I am giving this number to I would be able to figure out who it is anyway, so this is kinda where my project took of.
As I've posted about before I'm using the Google Enterprise services including email for my domains, I had somewhat of a naive hope that they would support some kind of macros when forwarding emails but unfortunately this wasn't the case.
Given the situation I decided to look into alternative ways to get the essential information to my mobile, what came to mind was a quick Perl hack.
This script is quite simple but yet powerful, essentially what it does is:
- Look for any unread message from Ballou notifying me that a new SMS has been delivered.
- Download the given email.
- Parse the email for the actual message.
- Mail to AT&T's mail-to-SMS service.
Oh and btw Ballou, please honor newlines and don't run s/\n//g on my messages, it's putting words together and it's honestly pretty damn annoying.