Re: Email to SMS

Andrew Lowe <[email protected]> Thu, 26 Aug 2004 09:18:58 +1000
Newsgroups gmane.comp.mobile.sms.tsms
Message-ID <[email protected]>
I do not have one, however a procmail script would do the trick...
have a look at:
man procmailex

something like:

:0 C
* ^To.*[email protected]
* ^From.*[email protected]|^From.*[email protected]|^From.*[email protected]
* ^Subject:.*URGENT ATTENTION REQUIRED*
| /bin/sms_client [RECIPIENT]

The first line, makes a copy, so a copy is stored in the inbox, and one 
is sent.
The next 3 lines are tests (with an AND between them so that all 3 lines 
must pass).
Line 2 is testing if the message was to [email protected] - passing if it 
is, otherwise the sms is not sent.
    this check is probably not needed, however it is helpful if you use 
aliases and want to filter based on that..
Line 3 is testing that it is from a valid user... valid users are 
[email protected], [email protected], [email protected]... if it is one of 
these it will pass, otherwise the sms is not sent.
    this is to stop just anyone sending you email2sms
Line 4 tests the if the subject contains the string URGENT ATTENTION 
REQUIRED
    again, this may not be needed, just remove lines not needed, but can 
be useful (you can use ! as a not) to filter only important messages
Line 5 sends the complete contents of the message to sms_client (replace 
[RECIPIENT] with the number (or name in address book) you want to send to)

Again, I am not sure how well this will work - I have not tried it - you 
may need to remove the new lines - sed s/\n/ /g should do it. I am just 
doing a lot with procmail at the moment.

You could probably add a rule to check the subject/sender for priority 
and depending on time of day, delay the sending of unimportant messages 
to a more reasonable time...

Somebody correct me if anything is wrong..

---

Andrew Lowe
    System Administrator & Programmer
        Information Technology
            Manildra Group

Email:   [email protected]



Steve wrote:

>Hi there guys does any one have a email to sms script.
>What I would like to have setup on my machine is a user say called sms
>When a message is sent to that user I would like it to send me a sms message
>with the subject and message body...
>  
>

--

-----------------------------------------------------------------------