hi,

There are many mailservers out there which do not recognize a 550
in the HELO/EHLO answer.  They will only give up when they get
a 550 on either the "MAIL FROM" or "RCPT TO" command.

I think we're getting there. Here is an improved version with just one caveat: When run through inetd it doesn't get the QUIT message:

  220 mx.hispeed.ch ESMTP
  QUIT
  ' unimplemented

Not sure where to look for the bug. When executed manually this problem
does not show up. Any bash/inetd-gurus here? :)

-------------------------------------------------------------
#!/bin/bash

host='mx.hispeed.ch'
msg='You are blacklisted, see http://url/to/policy.html'

echo "220 $host ESMTP"

while [ 1 ]; do
  read input
  cmd=`echo "$input" | awk '{print \$1}'`

  if [ "$cmd" = "HELO" ]; then
    echo "250 $host"
  elif [ "$cmd" = "EHLO" ]; then
    echo "250 $host"
  elif [ "$cmd" = "MAIL" ]; then
    echo "550 $msg"
    exit 0
  elif [ "$cmd" = "RCPT" ]; then
    echo "550 $msg"
    exit 0
  elif [ "$cmd" = "QUIT" ]; then
    echo "221 $host"
    exit 0
  else
    echo "500 '$cmd' unimplemented"
  fi
done
-------------------------------------------------------------

daniel
----------------------------------------------
[EMAIL PROTECTED] Maillist-Archive:
http://www.mail-archive.com/swinog%40swinog.ch/

Reply via email to