#!/bin/sh maxlen=200 mailfrom=short+err@ucw.cz rcptto=jan.kratochvil@sms.paegas.cz t=/tmp/smsnf.$$ head -qc 4k >$t hd=`sed -n -e '/^\$/=' -e '/^\$/q' <$t` (echo -n "` head -n $hd $t|sed -n \ -e 's/^Subject: *\(.*[^ ]\) *$/S:\1/p' \ -e 's/^From: *\(.*[^ ]\) *$/F:\1/p' echo B: tail +$hd $t|sed -n \ -e 's/^.*wr\(ote\|ites\):$//' \ -e '/^[^>]/p' `"|tr '\n' ' '|sed 's/\([^ ]\) *\( [^ ]\)/\1\2/g' \ |sed 's/^ *\([^ ].*\)/\1/'|sed 's/\(.*[^ ]\) *$/\1/') \ |head -c $maxlen >$t.2 (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 when problems occur. ";grep -v '^\.$' <$t.2;echo -e "\n.")|/usr/sbin/sendmail -bs &>/dev/null rm -f $t $t.2