Version of smsd: 3.0
Smsd installed from: sources
Name and model of a modem / phone: Huwei E169
Interface: USB
I have started to use and event handler to send out information based on a code that is sent by the users to the server. This works fine and so I want to limit the outgoing SMS messages to users with mobile numbers that are stored in an SQL database. I looked in the SMS Tools handbook and there is a Checkhandler example for checking users details from an SQL database so I modified it to meet my needs.
I just want to check that the senders number is in the database and if it is then the response message is allowed to go out.
This is my Checkhandler.sh file:
#!/bin/sh
#Extract data from the SMS file
to=`formail -zx To: < $1`
#log into mysql
SQL_ARGS="-h host100 -u user99 -p xxxxxx -D sms -s -N -B -e"
#Check result against phone number column in database
result=`mysql $SQL_ARGS select number from users where number = \"$to\"
if [ -z "$result" ]; then
exit 1
fi
The database is called SMS the table is called USERS and the searched column is NUMBER, all of the numbers are in the format 44778512345
A typical response message after the event handler has processed the senders request looks like this:
To: 447785123456
1st Bill Muirhead 07785135790
2nd John Moulson 0778524680
The problem is that the checkhandler filters everything and so no messages are allowed out and the log file says that the checkhandler has disallowed the message. I guess I am missing something simple here but I can't figure it out.

I would be grateful for some advice.
Thanks
Bill.