Skip to content

Commit

Permalink
Add support for redirect
Browse files Browse the repository at this point in the history
This patch tries to fix issue
 despf.sh fails to follow "redirect" in SPF records #27

http://www.openspf.org/SPF_Record_Syntax#redirect
  • Loading branch information
jsarenik committed Nov 29, 2015
1 parent d99826d commit 268f889
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions include/despf.inc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,15 @@ despf() {
}

echo "$host" >> "${myloop}"
myspf=$(parsepf $host)
getem $myloop $(echo $myspf | grep -Eo 'include:\S+')
getamx $host $myloop $(echo $myspf | grep -Eo -w '(mx|a)(:\S+)?')
echo $myspf | grep -Eo 'ip[46]:\S+' || true
myspf=$(parsepf $host | sed 's/redirect=/include:/')

set +e
dogetem=$(echo $myspf | grep -Eo 'include:\S+') \
&& getem $myloop $dogetem
dogetamx=$(echo $myspf | grep -Eo -w '(mx|a)(:\S+)?') \
&& getamx $host $myloop $dogetamx
echo $myspf | grep -Eo 'ip[46]:\S+'
set -e
}

cleanup() {
Expand Down

0 comments on commit 268f889

Please sign in to comment.