KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

SPF Test: checks if an Internet domain has an SPF record

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Library
View previous topic :: View next topic  
Author Message
terje



Joined: 25 Jul 2005
Posts: 88
Location: Sydney

PostPosted: Fri Sep 23, 2005 2:12 am    Post subject: SPF Test: checks if an Internet domain has an SPF record Reply with quote

We have created a script for testing whether a domain has an SPF record.

An SPF record identifies which servers are authorised to send email with the relevant domain name in the MAIL FROM:<xxx@domain.com> address part of the SMTP session. For details see http://spf.pobox.com

The script has been tested on a WINDOWS-2003 server running HOSTMONITOR v5.6beta.

The Hint for the script is: Params: <domain>
The start command for this script is: cmd /c %Script% %Params%

The body of the script is:-

Quote:
@echo off
REM query domain and return a SPF record status

if "%1"=="" goto NOPARAMS

setlocal

set DNS=%1
set FILE=%temp%\~spfcheck.%1.tmp
del %FILE%

nslookup -q=txt %DNS% > %FILE% 2>&1

FOR /F "tokens=*" %%B IN ('type %FILE% ^| FIND /I "***"') DO CALL :NODOMAIN %%B

FOR /F "tokens=*" %%B IN ('type %FILE% ^| FIND /I "v=spf"') DO CALL :OKRECORD %%B

echo ScriptRes:Bad:No Record
goto ALLDONE


:NODOMAIN
echo ScriptRes:Unknown:domain not found
goto ALLDONE

:OKRECORD
echo ScriptRes:Ok:%1
goto ALLDONE

:NOPARAMS
echo ScriptRes:Unknown:not enough parameters
goto ALLDONE

:ALLDONE
del %FILE%
exit


An example of a domain with an SPF record that you can use for testing is: google.com.au
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Library All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

KS-Soft Forum Index