Author |
Post |
|
#1 Fri Feb 18, 2011 09:24, 173 months ago.
|
Member
Registered: Feb 2011
Location: Neuchatel, Switzerland
|
Operating system name and version: Debian on Atmel architecture (FoxG20 device) Version of smsd: 3.1.14 Name and model of a modem / phone: Netus FoxBoard G20 Interface: serial ttyS1 Hello keke, I got sms server tools 3 and installed it correctly. It works well. I can send sms, multiple recipients etc.. But i have some difficult to setup sms2email function. I setup on my debian OS an exim4 tool with google smarthost as smtp. I can send mail to my account in command line as well. But when i put the same command in to eventhandler script file like this , i don't receive the mail. eventhandler = /usr/local/bin/smsd_eventhandler.sh
Could you help me please? What i am doing wrong? The mail program is locate in /usr/bin/mail path. And i could send simple test mail like this : echo -n "message" /usr/bin/mail Test -s username@gmail.com. Thank you. 
|
|
#2 Fri Feb 18, 2011 10:15, 173 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Use /usr/sbin/sendmail instead of /usr/bin/mail, or change the script like this: #!/bin/bash
EMAIL="username@gmail.com" if [ "$1" == "RECEIVED" ]; then if [ -n "$EMAIL" ]; then FROM=`formail -zx From: < $2` cat $2 | /usr/bin/mail \ -a "From: sms@localhost" \ -s "New SMS received from ${FROM}" \ "$EMAIL" fi fi 'bash' Syntax Highlight powered by GeSHi
|
|
#3 Mon Feb 21, 2011 08:55, 173 months ago.
|
Member
Registered: Feb 2011
Location: Neuchatel, Switzerland
Topic owner
|
Hello Keke, Sorry for reply late. I try your suggestion and it works well. But i would like to know what was wrong in the preview script? (for experience!!  ) Thank you.
|
|
#4 Mon Feb 21, 2011 09:28, 173 months ago.
|
Member
Registered: Feb 2011
Location: Neuchatel, Switzerland
Topic owner
|
Now I receive all sms like this:
From: 417XXXXXXXXX From_TOA: D0 alphanumeric, unknown From_SMSC: 419XXXXXXXX Sent: 11-02-21 09:49:03 Received: 11-02-21 09:49:44 Subject: SMSBOX Modem: SMSBOX IMSI: 22888880760546 Report: no Alphabet: ISO Length: 29
But i could not see the content of the sms forwarded. Witch parameter is missing in the script?
Thanks !
|
|
#5 Mon Feb 21, 2011 10:48, 173 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
1) Your modified script had leading whitespaces before headers. There should not be spaces, because line is then concatenated to the previous line.
2) /usr/bin/mail does not handle additional headers from the begin of message text. /usr/sbin/sendmail handles them. Probably gmail did not deliver the message, because of missing subject.
The script (post #2) is not missing parameters. It works with google as smarthost, but probably some whitelisting is required on the recipients side. Also, when I tested this, some messages were not shown immediately, there was some delay.
|
|
#6 Mon Feb 21, 2011 11:06, 173 months ago.
|
Member
Registered: Feb 2011
Location: Neuchatel, Switzerland
Topic owner
|
Great Thanks For fixing all bugs. Everything is OK. 
|