News Blogs: My News: Blog Search the Web Boats Bracelets Vicodin online Boots Loan Online Underwear furniture Sport Betting Cars Free Ringtones Top casino Best Ringtones Ornaments Cialis online Sale Auto Tunings Adipex online Cigarettes Online notebook shop Tables Medical tests Green Card Information mp3 music for mobile Phentermine online Balans FDA Approved Pharmacy Dating Sportswear Autos Xanax online Building materials Rolex Replica Intimate goods Get ringtones online Free Ringtones Ambien online Mobiles Ladies handbag Phentermine No Prescription Medicine news Replica Rolex Free mp3 ringtones Download Ringtones Fioricet online Valium online Trousers Cheap pharmacy shop Evening dress Pills, Compare pills, Reviews pills ya.by Yachts Ear rings Cases Soma online Chronometer Chairs Suits Fashions Rington Cigarette Necklace Credit

Send Email Updates through SMS

I had the idea of sending myself an SMS message anytime I received an email. I know that can be overbearing for some, and even me for my non-personal email. Since I don’t really get anything but person-to-person emails there, I figured it would be worth it to try. Also, I got my cellphone before AT&T Wireless was bought up by Cingular. Therefore I’m still on an old AT&T plan which doesn’t charge for incoming SMS messages, so it wouldn’t cost me anything. I’m running my personal email through a hosting company (DreamHost), so I decided to try using procmail to do it. Another option was to rely on a client to forward the messages. While this may be straightforward for some, I had no experience at all in procmail. Read on to see how I got it to work.
First thing was to find out what email address I could use to send SMS messages to my phone. This page lists what many phone companies use as their e-mail addresses for the cellphone numbers. I also had a bit of fun testing to make sure that it would work. I did find out that if I tried to send an email that was too large for a text message, it wouldn’t send anything. This meant that I had to trim down the message if it was too large. To make it easy for my first shot, I decided that I should just remove the body and only send the original sender and the subject line.

Next up was to learn a little procmail magic. I had a little fun getting the DreamHost end of the it all working because they seem to prefer that you use the web interface. After messing around and looking up many online resources and samples, I came up with this script.

:0c
* ! ^X-Loop: sms_procmail
| (formail -X "Subject:" -X "From:" 
-I "X-Loop: sms_procmail" -X "X-Loop:" 
-I "To: 8005551212@mmode.com" -X "To:" ; 
echo "--Body Removed--" ) 
| /usr/lib/sendmail -oi -t

I’ll try to describe it line by line. The first line is just procmail syntax to start a ‘recipe’, a mail processing directive, and do the recipe on a message copy. The next line (”* ! ^X-Loop…”) says to ignore any email that has the header ‘X-Loop: sms_procmail’. This is to prevent email loops caused by repeatedly sending the message around and around. This shouldn’t happen, but everyone says it’s good practice. The lines that start with a pipe (’|') are actions to perform. The ‘formail’ command does work on the incoming mail. The ‘-X’ options tell which email headers to include (extract) from the original. The ‘-I’ options insert headers, overwriting previous headers. The whole formail command brings just the subject and adds the correct To: field and the loop-preventing field. The echo line is partially to tell me that there will be no body added. However, I found that I had to put something there otherwise the subject line wouldn’t show up in the resulting SMS message. The final line is actually send the message using sendmail.

I sent a few testing emails and it works great! The lag between sending the message from GMail and a notification on my phone is generally under 20 seconds. Not too bad, considering all the loops that are being leapt through.

My next idea is to try to trim the body and possibly send the actual body if it’s less than 100 characters. I’m not sure how interesting that would be though. How many emails really only have 100 characters in the body? I don’t think that many. But then again, how many people really need to have an immediate SMS update of an email? I don’t think that many. I actually don’t even think I’m one of them :-) .

3 Responses to “Send Email Updates through SMS”

  1. Clara-ia Says:

    dockers mailing address

  2. jafer Says:

    updates on it field

  3. Marcus Toffolo Says:

    12

Leave a Reply

It sounds like SK2 has recently been updated on this blog. But not fully configured. You MUST visit Spam Karma's admin page at least once before letting it filter your comments (chaos may ensue otherwise).