SmsMail


The SmsMail perl script allows checks your inbox on a linux system every 30 seconds to see if new messages have arrived. If a new message has arrived a SMS message is sent to your phone via a web interface provided by your wireless service provider. To use this script you will need an e-mail account and access to a system that can run perl programs and a wireless account with internet text message service. This program is known to work on Linux systems when accessing a Linux mail server. Other configurations may or may not work. Perl implementations are freely avaliable for Unix, Macintosh and Windows systems from perl.com.

Installation

This program will produce best results if it is installed on a computer that is always turned on and connected to the Internet. If you have a Unix shell account on a server that your school or ISP provides, this would be an ideal place to run it. To download this program to your shell account, log in via telnet or ssh and type the command wget http://www.bump.us/cellphone/smsmail.pl to download the script. Then you can use the command chmod +x smsmail.pl to tell the computer that this file is a program. If you would rather download it directly to your PC for some reason, you can click on this link.

Now you are ready to modify the configuration values in the program to make it work with your e-mail account and mobile phone. Open smsmail.pl in your favorite text editor and follow the directions in the Configuration section below. If you don't have a favorite text editor, use the command pico smsmail.pl to open the file for editing.

Configuration

To use this script, you will need to set up a few items in the file to make sure that your messages get delivered to you. The section that you will need to change looks something like this:

#######Configuration Section########
$mailUser = "yourPOP3Username";
$mailPass = "yourPOP3Password";
$mailServer = "mail.yourpop3.com";

$webServer = "www.your.provider.com";
$webUrl = "http://www.your.provider.com/send.pl?number=##########&message=";

###################End Configuration#####################

Change the part in quotes following $mailUser and $mailPass to be your e-mail user name and password. Make sure that there are quotes around your user name and password and that each of these lines ends with a semicolon. Change the part after $mailServer to the name of the server that you get your mail from. This is probably the same as the part after the @ sign in your e-mail address.

The values for $webServer and $webUrl may be a little more difficult to find. I will try to be of some help here and list some that I know. In each of these examples you will need to substitute your phone number for the ########## in the example. Also notice that the part after the = sign in $webServer = is the same as the part between the http:// and the first / mark in the $webUrl part. If your's isn't listed here, go to the webpage that you use to send a message to a phone and view the source. You may be able to determine how the data from the form gets submitted.

If you find the proper settings for a provider not listed here, e-mail me and I'll add them to this page for the benefit of others.

Using smsmail.pl

To start smsmail.pl use the command ./smsmail.pl & using an & at the end makes it so that the script will continue running even after you have logged off. Be aware that you will need to restart mailscript if your mail server gets rebooted. To do this, just log in via telnet or ssh and type ./mailscript & again. If you happen to be root on the system you are running this on you could set your init scripts to do this for you, but most of us aren't that lucky.

If you have any questions about how all of this works feel free to drop me an e-mail and I'll do my best to help you out.