SMS Server Tools 3
This site is hosted by Kekekasvi.com
 Menu
Basic information:
Additional information:
Support:
Get SMS Server Tools 3:
Additional Options

 Sponsored links

 Search
Custom Search

 Visitor locations
 
 SMS Server Tools 3 Community
Welcome, Guest. Please login or register. Sun Feb 28, 2021 15:58
SMSTools3 Community » Help and support Bottom

[answered] sms2email bug!

  This topic is locked

Page:  1

Author Post
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. :'(

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


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!! :D )

Thank you.

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 !

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.

Member
Registered:
Feb 2011
Location: Neuchatel, Switzerland
Topic owner
Great Thanks For fixing all bugs.
Everything is OK.
:D

  This topic is locked

Page:  1

SMSTools3 Community » Help and support Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.