A few weeks ago I was asked to help set up a system where an email would be texted to someone so long as a certain keyword was used in the subject line.
My solution should work under any Unix/Linux system, assuming you have 02sms installed and have an alias set up in in your .o2smsrc for texting SMSs to yourself; my alias is named ‘me’. This also assumes that you have procmail set up and requires the following snippet to be pasted into your .procmailrc and edited as required.
The snippet is set so an email is only forwarded by SMS if it is sent by one of two approved email addresses and the subject line contains the phrase ‘txtken’ with no leading or trailing spaces.
:0
* 1^0 ^From:.*xxx@xxxxx.xx
* 1^0 ^From:.*yyyyy@yyyy.yy
* ^Subject: txtken$
| formail -k -X From: | o2sms me > /dev/null