Skip to content

Instantly share code, notes, and snippets.

@jonpryor
Last active August 29, 2015 13:57
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save jonpryor/9647759 to your computer and use it in GitHub Desktop.
#/usr/bin/env perl -w
use strict;
use Mail::SPF;
my $spf_server = Mail::SPF::Server->new(
# Optional custom default for authority explanation:
default_authority_explanation => 'See http://www.%{d}/why/id=%{S};ip=%{I};r=%{R}',
max_dns_interactive_terms => 18
);
foreach my $argnum (0 .. $#ARGV) {
my $identity = $ARGV[$argnum];
my $request = Mail::SPF::Request->new (identity => $identity, ip_address => '192.168.1.1');
my $result = $spf_server->process($request);
print "$identity: $result\n";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment