Hallo, Daniel Lorch <[EMAIL PROTECTED]> schrieb: > Not sure where to look for the bug. When executed manually this problem > does not show up. Any bash/inetd-gurus here? :)
Not realy guru, but I have get it to run on OpenBSD3.4/alpha/current, but I had to change some things. The problem was that the tcp connection sends some more data, there are better/shorter ways to write the script, but it works... -----8<----- #!/bin/sh stty raw host='mx.hispeed.ch' msg='You are blacklisted, see http://url/to/policy.html' cmd="" echo "220 $host ESMTP\r" while true do c=`dd bs=1 count=1 2>/dev/null` if echo $c | egrep -i '[a-z]' >/dev/null ; then cmd="${cmd}${c}" else cmd="" fi if echo $cmd | egrep -i 'HELO' >/dev/null ; then echo "250 $host\r" elif echo $cmd | egrep -i 'EHLO' >/dev/null ; then echo "250 $host\r" elif echo $cmd | egrep -i 'MAIL' >/dev/null ; then echo "550 $msg\r" break elif echo $cmd | egrep -i 'RCPT' >/dev/null ; then echo "550 $msg\r" break elif echo $cmd | egrep -i 'QUIT' >/dev/null ; then echo "221 $host\r" break else if echo $cmd | egrep -i '^[a-z][a-z][a-z][a-z]$' >/dev/null ; then echo "500 '$cmd' unimplemented\r" fi fi done stty -raw ----->8----- -- [EMAIL PROTECTED]: http://www.grillsportverein.de/sf.jpg ---------------------------------------------- [EMAIL PROTECTED] Maillist-Archive: http://www.mail-archive.com/swinog%40swinog.ch/