From 4e36e673ffc628b2e863738b90a375b240bd2847 Mon Sep 17 00:00:00 2001 From: MeaTLoTioN Date: Thu, 6 Mar 2025 22:07:08 +0000 Subject: [PATCH] make spf_check.sh a little more efficient, and add a 2nd script that is super condensed for funsies --- spf_check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spf_check.sh b/spf_check.sh index 829d9d6..ab8c637 100755 --- a/spf_check.sh +++ b/spf_check.sh @@ -10,7 +10,7 @@ esac COUNT=0;DEPTH=0;mDEPTH=0;INDENT=2; checkIncludes() { SPF=$1 - for I in $(dig -t txt $SPF +short|grep -oE "include:.* |ip[4,6]:.* "|sed 's/include://g; s/ip[4,6]://g; s/\"//g'|tr ' ' '\n'); do + for I in $(dig +short TXT $SPF|grep -oE 'include:[^ ]+|ip[46]:[^ ]+'|sed -E 's/include:|ip[46]:|"//g'); do [[ $DEBUG ]] && printf "%*s%s %s\n" $(($DEPTH*$INDENT)) '' "$I" if [[ ! ${I} =~ ^[0-9] ]]; then DEPTH=$(($DEPTH+1))