Note: the solutions described in this document no longer function on the Rogers cellular network, as of June 2005 or so, when Rogers defeated automated access to their email gateway. Other networks may still work as always.

The Email2SMS gateway

This collection of files can be used to build a quick and dirty Email-to-SMS gateway. The idea is, you send an email to yourname-sms@yourdomain.com, and it gets forwarded to your phone via SMS. What's this? Your cellular provider already has an email2sms gateway? Well that's great, but Rogers AT/T wireless, up here in the Great White North at least, badly mangled their gateway. It exists, but it may as well not, for the trouble it takes. Thus, I set out to implement my own (with tremendous assistance from rootstyle, good work brother!)


Here is a breakdown of the components:

mail2sms-1.3.5.tar.gz
This is a straightforward little C program; it takes full email message from stdin, and outputs an SMS-tailored message to stdout, containing configurable portions of the email, such as sender, subject, body, etc. Samples and stuff are all included in the archive, but to give you a taste, here is my personal .mail2sms file. (Obviously, the file has to be named ".mail2sms".)

Here is the author's homepage: http://daniel.haxx.se/projects/mail2sms/.

smssend-3.4.tar.gz
This is a much more interesting little C program; it takes, either from stdin or directly as parameters, an SMS message. Along with parameters specifying the target device, it sends the SMS to your phone, as if by magic!

The program is quite sophisticated. Cellular providers are accessed by it via modules, and the modules include homepages, allowing both the program and the individual modules to check for updates, in a distributed development environment. This is certainly the backbone of our Email2SMS gateway, and needless to say, it has plenty of other scriptable applications.

Here is the author's homepage: http://zekiller.skytech.org/smssend_menu_en.html. Definitely go read this one, the guy is brilliant.

qmail-1.03.tar.gz
Okay, you probably don't need to download this from here. (In fact, the link is dead, just to discourage idiots.) What you do need is this: my .qmail-sms file. Actually, you can just make it yourself, you lazy ass. Here are the magic contents:
   |~/usr/bin/mail2sms -o |/usr/bin/smssend rogers 4165553223 -
   
The QMail homepage: http://cr.yp.to/qmail.html. If you aren't already using QMail, you shouldn't be here, you should be <-- THERE.

So here is the basic idea: QMail gets the email, and pipes it to mail2sms. This outputs the message in a nice compact SMS size, and (quietly, aka, -o) passes it to smssend, which sends it off to your phone, with the hard-coded SMS number you put. (No, that isn't my number up there.) Could it be any simpler?

No, but it could be more difficult. Notice that there is no flood protection, message splitting, or anything of the sort. So can we tweak this any? ... Someone remind me to add some tweaks to this page, once we come up with them. Until then, good luck.

Feel free to email me if you need any other help.

And if you get a gateway setup, send me an SMS-email and tell me about it! You guessed it: maitre-sms@ultrx.yi.org ... Should I be worried about SMS spam? :)
Update: You're damn right I should have been worried about SMS spam! It probably only took a few months for it to start, but by then Rogers had also taken down the email gateway, so I didn't even notice until I fixed my relay later. You better just get used to it! Meanwhile, you will have to prefix ULTRX to any email you send me, otherwise it will be dropped.


Updated 2005.11.02.
Copyright © 1994 - 2004 UltrX corp. All rights reserved.