RFC822 sendmail communication, +err FROM address, "version 1.1"
authorshort <>
Tue, 10 Jul 2001 18:26:56 +0000 (18:26 +0000)
committershort <>
Tue, 10 Jul 2001 18:26:56 +0000 (18:26 +0000)
bin/smsnf

index f872edb..28123f8 100755 (executable)
--- a/bin/smsnf
+++ b/bin/smsnf
@@ -1,7 +1,7 @@
 #!/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
@@ -19,8 +19,13 @@ tail +$hd $t|sed -n \
 |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