Operating system name and version: Ubuntu 10.04
Version of smsd: 3.1.11
Smsd installed from: sources
Name and model of a modem / phone: Teltonika G10
Interface: USB
Hi,
I have a problem with the email2sms script from this page.
SMSD is working, I receive sms when I put a sms file to /var/spool/sms/outgoing
Now I to send a mail to "+49176XXXXXXXXX" <sms@mydomain.com>
This is the result in procmail.log :
----------------------
From my@email.com Thu Feb 17 14:38:55 2011
Subject: Halali
Folder: /usr/local/bin/email2sms 5567
mktemp: failed to create file via template `/var/spool/sms/outgoing/smsgw.out.XXXXXX': Permission denied
/usr/local/bin/email2sms: 43: cannot create : Directory nonexistent
chmod: missing operand after `666'
Try `chmod --help' for more information.
-------------
This is the content of the email2sms script I have stored under /usr/local/bin/email2sms:
tmp=$(mktemp /tmp/smsgw.XXXXXX)
cat >$tmp
destinations=`formail -zx "To:" < $tmp`
IFS=,
for destination in $destinations; do
destination=${destination## }
OUTFILE=$(mktemp /var/spool/sms/outgoing/smsgw.out.XXXXXX)
formail -f -I "To: $destination" < $tmp > $OUTFILE
chmod 666 $OUTFILE
echo "SMS queued to $OUTFILE"
done
rm $tmp
----------------
So apparently something with folder permissions.
Could anyone with better Linux/Unix understanding than I have explain what I have to change to make it work?
Thanks and best regards,
Matthias