Keywords: Mode: All keywords (AND) |
Tue Mar 14, 2017 15:00
|
n00bie: Hi,
Thanks for your quick answer.
I changed the checkhandler path in the smsd.conf
old path
checkhandler = /var/spool/sms
new path
checkhandler = /var/spool/sms/smsd_checkhandler.sh
I didn't have the problem but I have had new one:
2017-03-14 15:22:17,7, smsd: Done: checkhandler, execution time 0 sec., status: 0 (0)
2017-03-14 15:22:17,3, smsd: Exec: checkhandler encountered errors:
2017-03-14 15:22:17,3, smsd: ! /var/spool/sms/smsd_checkhandler.sh: 1: /var/spool/sms/smsd_checkhandler.sh: formail: not found
2017-03-14 15:22:17,5, smsd: Moved file /var/spool/sms/outgoing/FX.txt to /var/spool/sms/checked
But I found the solution here: http://smstools3.kekekasvi.com/topic.php?id=1177
I didn't have procmail.
Everything works well now.
Many thanks for your help.
Best regards,
|
Tue Mar 14, 2017 13:41
|
n00bie: Operating system name and version: UBUNTU 16 (fresh install)
Version of smsd: the one when request apt-get install smstools
Smsd installed from: default Ubuntu repository
Name and model of a modem / phone: HUAWEI 3G modem E3372
Interface: USB
Hi,
First, thanks for this great tool.
Just to be clear, I don't speak English fluantly so please excuse me for gramatical error and I'm a real noob in linux world...
I have a little trouble with smstools and the possibility of sending a sms to many phone numbers.
I read this topic: http://smstools3.kekekasvi.com/topic.php?post=2640#post2640 but that don't really help me (except for the script)...
Everything works fine, I can send and receive sms to single phone number without problem.
The problem comes when I add a second or more than one phone number in the sms file.
I used the checkhandler script of the upper topic:
#!/bin/bash
# Sample script to allow multiple recipients in one message file.
# Define this script as a checkhandler.
outgoing="/var/spool/sms/outgoing"
recipients=`formail -zx "To:" < "$1"`
#count=`echo "$recipients" | wc -l`
count=`echo "$recipients" | wc -w`
if [ $count -gt 1 ]; then
# Will need echo which accepts -n argument:
ECHO=echo
case `uname` in
SunOS)
ECHO=/usr/ucb/echo
;;
esac
messagebody=`sed -e '1,/^$/ d' < "$1"`
headers=`formail -X "" -I "To:" -f < "$1"`
for recipient in $recipients
do
file=`mktemp $outgoing/send_XXXXXX`
$ECHO "To: $recipient" > $file
if [ "x$headers" != "x" ]; then
$ECHO "$headers" >> $file
fi
$ECHO "" >> $file
$ECHO -n "$messagebody" >> $file
done
# Remove processed file:
rm $1
# Tell to smsd that checkhandler has spooled this message:
exit 2
fi
exit 0
I stored it there: /var/spool/sms/check_handler.sh and give the path in /etc/smsd.conf
The folder and subfolder give full access to smsd and root user.
Unfortunatly, the /var/log/smsd.log file give me the result below and I don't understand why...:
...
smsd: Running checkhandler: /var/spool/sms /var/spool/sms/outgoing/filename.txt
smsd: Done: checkhandler, execution time 0 sec. status: 32256 (126)
smsd: Exec: checkhandler encountered errors:
smsd: ! sh: 1: /var/spool/sms Permission denied
smsd: Moved file /var/spool/sms/outgoing/filename.txt to /var/spool/checked
...
Could you please help me?
Many thanks
|