#test procedure
#--------------------------------------------------------------------
test : clean debug
- @ bin/valide data-tst/spf.tst
+ @ shell/test-spf.sh data-tst/spf.tst
#--------------------------------------------------------------------
#Installation procedure
#========================================================
#data to check if SPF are properly seen
-chkmx.spf.example.com#NOTE: this test rely on the fact
-#"spf.example.com" is accessible via DNS request.
+#NOTE: this test rely on the fact
+#"spf.example.com" is accessible via a DNS request.
#========================================================
-#--------------------------------------------------------
#Checking MX
#Acceptable IP number
spf_pass chkmx.spf.example.com 127.0.0.255
//version definition
#define VERSION "0.4.2"
-#define RELEASE "34"
+#define RELEASE "35"
//Public variables
PUBLIC int debug=0; //debug level
#---------------------------------------------------------------------
#shell script to test SPF directive
#---------------------------------------------------------------------
+while [ $# -gt 0 ]
+ do
+ filename=$1
+ numline=0
+ echo "scanning \"$1\" test file"
+ cat $1 | while read line
+ do
+ numline=$((numline+1))
+ data=`echo $line | grep -o '^[^#]*'`
+ if [ -z "$data" ] ; then
+ continue;
+ fi
+ expect=`echo $data | cut -d ' ' -f1`
+ domain=`echo $data | cut -d ' ' -f2`
+ ipnum=`echo $data | cut -d ' ' -f3`
+ result=`bin/chkspf $domain $ipnum`
+ if [ "$result" != "$expect" ] ; then
+ echo "error: line $numline, Expected:=$expect Result:=$result"
+ fi
+ done
+ shift
+ done