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. Sat Apr 20, 2024 06:26
SMSTools3 Community » Bug reports Bottom

[fixed in 3.1.14] Email2sms doesn't work if more than one recipient

Login and Post Reply

Page:  1

Author Post
Member
Registered:
Nov 2009
Location: Finland
Hello!

I just created an fresh installation of smstools for our system monitoring. However there seems to be an issue with email which has more than 1 recipient, only first recipient receives mail.

I suppose I could go around this with tweaking postfix and/or fetchmail, but that feels like going around the problem. On sent messages I have an header like this:


(There's an additional space intentionally, forum makes a mess if there's a "valid" mail address)

The first number receives the SMS just like it should, but the second doesn't and there's nothing on the logs either, so it seems like that the another number is discarded.


« Last edit by take on Mon Sep 13, 2010 19:52, 165 months ago. »
Administrator
Registered:
May 2009
Location: Jyväskylä, Finland
Here is a new script email2sms:

#!/bin/sh

# Smsd can send eMails via SMS. You simply need to store the eMail as text
# file in the outgoing queue directory with a unique filename.

# The eMail must include the phone number in the To: field, for example:
# To: "Herbert +491721234567" <sms@localhost>

# This simple script creates a unique filename and copies the eMail from
# stdin to that file.

# If you use procmail to deliver local eMail. Create the user sms and create
# the file /home/sms/.procmailrc with this content:

# VERBOSE=off
# MAILDIR=/var/spool/mail
# DEFAULT=/var/spool/mail/sms
# LOGFILE=/var/log/procmail
#
# :0
# * ^TOsms
# | /usr/local/bin/email2sms



# If you use QMail and vpopmail you need the file
# /home/vpopmail/domains/your-domain/.qmail-sms with this content:

# | /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
 
 
'bash' Syntax Highlight powered by GeSHi


Member
Registered:
Nov 2009
Location: Finland
Topic owner
This seems to work just fine. Thanks for the quick fix! I've just been too busy to actually test it out earlier.

Another thing, merely an feature request, but anyway, it'd be nice to have an option to send either subject or the body. However my needs are a bit more complex, since I'd need to do that based on the sender etc, that I suppose I'll craft something by myself when I find the time for it.

Login and Post Reply

Page:  1

SMSTools3 Community » Bug reports Top

 
Time in this board is UTC.  

Privacy Policy   SMS Server Tools 3 Copyright © Keijo Kasvi.