Keywords: Mode: All keywords (AND) |
Thu Mar 17, 2011 16:15
|
angeldark: Thanks i will make a try and get you know. thanks
|
Tue Mar 15, 2011 23:30
|
angeldark: In fact it was more easy that i was trying to do...
thanks for your replay i have it almost done, there is only on prob. i cant get some acentuate charset like á à ã every all are working fine.
there is my code:
#!/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' < "$TMPFILE"`
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
if sed -e '/^$/ q' < "$1" | grep "^Alphabet: UTF-8" > /dev/null; then
TMPFILE=`mktemp /tmp/smsd_XXXXXX`
sed -e '/^$/ q' < "$1" | sed -e 's/Alphabet: UTF-8/Alphabet: UCS2/g' > $TMPFILE
sed -e '1,/^$/ d' < $1 | iconv -f UTF-8 -t UNICODEBIG >> $TMPFILE
mv $TMPFILE $1
fi
done
# Remove processed file:
rm $1
# Tell to smsd that checkhandler has spooled this message:
exit 2
fi
exit 0
|
Tue Mar 15, 2011 01:55
|
angeldark: Hello i am trying without sucess update this script for make it work with Accentuated character conversion like is describe in http://smstools3.kekekasvi.com/topic.php?id=166 can someone help me doing that? thanks Alot.
|