#!/bin/sh

TCPREMOTEIP=10.1.1.1
export TCPREMOTEIP

verify () {
  lf="${1:-result}"
  echo out to $lf 
  echo '' > $lf
  for helo in `cat dat-helo`; do
   for from in `cat dat-mailfrom`; do
     for rcpt in `cat dat-rcptto`; do
       if cat<<_EOF | ./start-null 2> /dev/null | grep '^553' > /dev/null
HELO $helo
MAIL FROM: $from
RCPT TO: $rcpt
_EOF
       then
         echo NG=$helo $from $rcpt
       else
         echo OK=$helo $from $rcpt
       fi >> $lf
     done
   done
  done
}

verify "$@"
