Email Notification via SMS in the US?
Joel McShiston asks: "Back in Europe I had set up a system through which urgent emails matching certain criteria were automatically forwarded upon arrival to a (free) email account which my cell phone carrier (Vodafone) provided for free with each account - {cell number}@vodafone.es. At the carrier's site I could then turn 'SMS notification of new email' on and would receive a text message telling me to check my email each time a matching email came through. I'll be soon moving to the US and would like to know whether any of you has a similar (or better) system working over there. Which kind of SMS-email 'interfacing' are you able to do on that side of the pond?"
See my instructions. While specifically for Verizon, the technique should work for any carrier that supplies you with an e-mail address.
If you reply, do so only to what I explicitly wrote. If I didn't write it, don't assume or infer it.
I've been using my phone as a biff for years. If an e-mail is important I know about it right away, if it isn't important I can deal with it later or ignore it completely.
echo '\'$USER', "|'$HOME/.do_sms_spawn'"' > ~/.forward
/%/g' | tr -d '\n') /dev/null 2>&1
cat >~/.do_sms_spawn.in <<EOF
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv) {
chdir("HOME");
execlp("BASH", "bash", "HOME/.do_sms", NULL);
exit(1);
}
EOF
sed 's/HOME/'$HOME'/g;s/BASH/'`which bash`'/g' <~/.do_sms_spawn.in >~/.do_sms_spawn.c
cc ~/.do_sms_spawn.c -o ~/.do_sms_spawn
cat >~/.do_sms <<EOF
#!/bin/bash
do=0 #0=email,1=SMS
part=0 #0=headers,1=body,2=tagline
msg=
debug=n
exec >/dev/null 2>&1
debuglog=$HOME/sms-debug.log
while : ; do
read line || break
if [ "$debug" = "y" ] ; then echo $part$do $line >$debuglog ; fi
if [ $part -eq 0 -a "$line" = "" ] ; then
part=1
elif [ $part -eq 0 -a "$(echo $line|cut -c1-4)" = "To: " ] ; then
echo "$line" | fgrep "+sms@" >/dev/null 2>&1 && do=1
elif [ $part -eq 0 -a "$(echo $line|cut -c1-6)" = "From: " ] ; then
msg=$(echo $line|cut -c7-|cut -d\< -f2|cut -d\> -f1)
elif [ $part -eq 1 -a "$(echo $line|cut -c1-2)" = "--" ] ; then
part=2
elif [ $part -eq 1 -a $do -eq 1 ] ; then
msg="$msg $line"
fi
done
if [ $do -eq 1 ] ; then
msg=$(echo $msg|cut -c 1-160)
msg=$(echo -n "$msg" | od -t xC | cut -c8- | sed 's/
if [ "$debug" = "y" ] ; then echo msg: $msg >$debuglog ; fi
s='http://208.62.68.135/msgresult.shtml?min='`cat ~/.cellno`'&msg='
wget -q "$s$msg" -O
fi
EOF
chmod 700 ~/.do_sms
um=`umask`
umask 077
echo XXXXXXXXXX > ~/.cellno
umask $um
mail Hi there. | $USER'+sms@'$HOST
--TheOrangeSquid Is it any wonder things seem so awry? We swim in a sea of confusion and don't have to think to survive
Considering that the OT comes from Europe, there is a very important thing to add - you will pay for incoming SMS (or have them deducted from your bucket of allowed SMSs - depending on your provider and/or plan). As opposed to Europe (at least the countries I lived in) where all incoming communication is free, you will pay for that in the US - both, for voice as well as SMS. So, depending on your email volume, you might re-think whether this is really worth it... (I use it - T-Mobile customer - and their website allows you to set up rather precise filters for which messages/accounts/senders/... you receive a notification)