Hi all!

take for example this code:
===============================================
filter_sms ()
{
 egrep -v "^To:|^From
|^Return-Path|^X-Original|^Delivered-To|^Received|^id|^MIME|^User-Agent|^Date:|^Content|^Message-Id|^From:|active
bounce corrupt|^\*\*\*\*\* Nagios"|sed -e "s/Notification Type: //"|sed -e
'/^$/d'
}
DEST=$1
if [ -z "$DEST" ]; then
  printf "Destination: "
  read DEST
fi
set -x
FILE_MSG=`mktemp /var/spool/sms/outgoing/send_XXXXXX`

echo "To: $DEST" > $FILE_MSG
echo "" >> $FILE_MSG
read line
while read line
do
echo $line
done | filter_sms >> $FILE_MSG
===============================================
now, implementation has been to enable thru sms messaging using sms 3 server
tools and postfix.
by default this code should be able to remove/strip unnecessary headers on
Email type format and have this sent thru sms gateway.

But we encountered problems associated with the:

while read line
do
echo $line

which works fine if you issue the command cli> echo this is a test | mail
<localaccount-email>
looking closely at the /var/spool/sms/outgoing  (directory) sms3 creates a
file according to what you have defined in the /etc/smsd.conf

you get an output let say:
To: +639166185688

this is a test
----------------------------------

but whe you issue the command: cli> echo this is a test | sendsms
<localaccount-email>
you should get as expected:

To: +6391661865688

this is a test

however, this would not be the case since it is going to grep the contents
of the directory.  this script is a work in progress and needs much testing
to fire it up and work correctly.  appreciate comments from the list.

cheers

-- 
Ronald Allan V. Tomimbang
Computer Center Administration / Unix
Office of Information Systems and Technology
Asian Development Bank
email: [EMAIL PROTECTED]
mobile: 0922-8158229
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
[email protected] (#PLUG @ irc.free.net.ph)
Read the Guidelines: http://linux.org.ph/lists
Searchable Archives: http://archives.free.net.ph

Reply via email to