#!/bin/sh
-#num=431329
-#addr="http://sms.paegas.cz/wwwsms/index.phtml"
-maxlen=310 #316
+maxlen=200
+mailfrom=short+err@ucw.cz
+rcptto=jan.kratochvil@sms.paegas.cz
t=/tmp/smsnf.$$
head -qc 4k >$t
|sed 's/^ *\([^ ].*\)/\1/'|sed 's/\(.*[^ ]\) *$/\1/') \
|head -c $maxlen >$t.2
-#(echo -n "num=$num&text="
-#urlencode <$t.2
-#echo -e "\n---")|lynx -post_data $addr >/dev/null #>>~/Mail/smsn.out
-(echo -e "From: @.\n";cat $t.2)|/usr/sbin/sendmail jan.kratochvil@sms.paegas.cz
+(echo -n "EHLO ";hostname -f;echo "\
+ONEX
+MAIL FROM: $mailfrom
+RCPT TO: $rcptto
+DATA
+From: @.
+To: $rcptto
+X-SMSNF-Notice: Generated by SMSNF, contact Jan Kratochvil <short@ucw.cz> when problems occur.
+";grep -v '^\.$' <$t.2;echo -e "\n.")|/usr/sbin/sendmail -bs &>/dev/null
rm -f $t $t.2