#!/bin/sh -e
#
# Usage: ./despf <domain_with_SPF_TXT_record>

# Check for required tools
for cmd in dig awk grep sed cut
do
  type $cmd >/dev/null
done

a="/$0"; a=${a%/*}; a=${a#/}; a=${a:-.}; BINDIR=$(cd $a; pwd)
. $BINDIR/include/global.inc.sh
. $BINDIR/include/despf.inc.sh

# Read DNS_TIMEOUT if spf-toolsrc is present
test -r $SPFTRC && . $SPFTRC

loopfile=$(mktemp /tmp/despf-loop-XXXXXXX)
echo random-non-match-tdaoeinthaonetuhanotehu > $loopfile
trap "cleanup $loopfile; exit 1;" INT QUIT

domain=${1:-'orig.spf-tools.ml'}

despfit $domain $loopfile
cleanup $loopfile

#!/bin/sh -e
#
# Usage: ./despf <domain_with_SPF_TXT_record>

# Check for required tools
for cmd in dig awk grep sed cut
do
  type $cmd >/dev/null
done

a="/$0"; a=${a%/*}; a=${a#/}; a=${a:-.}; BINDIR=$(cd $a; pwd)
. $BINDIR/include/global.inc.sh
. $BINDIR/include/despf.inc.sh

# Read DNS_TIMEOUT if spf-toolsrc is present
test -r $SPFTRC && . $SPFTRC

loopfile=$(mktemp /tmp/despf-loop-XXXXXXX)
echo random-non-match-tdaoeinthaonetuhanotehu > $loopfile
trap "cleanup $loopfile; exit 1;" INT QUIT

domain=${1:-'orig.spf-tools.ml'}

despfit $domain $loopfile | grep .
cleanup $loopfile

Return 1 on empty output
Return 1 on empty output

Fixes issue
 despf.sh fails silently #33
