#!/bin/bash 


SENDMAIL="/usr/sbin/sendmail -bt"
RULESET="check_rcpt"
#PTRNAME=`dig -x $1 +noall +answer +nocommand +nocomments | grep -v '^;' | grep 'PTR' | expand - | cut -d' ' -f5 -z`
PTRNAME=`dig +short -x $1`

SM_BT_CMD="
.D{client_addr}$1
.D{client_name}$PTRNAME
.D{f}$3
${RULESET} $2
"

echo "$SM_BT_CMD" | ${SENDMAIL} $4
echo -e "\n"



