Config option to use SPF records

This commit is contained in:
Jamie Cameron
2013-02-22 14:09:09 -08:00
parent 7fd6dd2943
commit 32db124487
56 changed files with 60 additions and 5 deletions

View File

@@ -52,3 +52,4 @@ dnssectools_rollrec=/var/named/system.rollrec
dnssectools_keydir=/var/named/dtkeys
dnssectools_rollmgr_pidfile=/var/run/rollmgr.pid
force_random=0
spf_record=0

View File

@@ -45,3 +45,4 @@ checkconf=named-checkconf
other_slaves=1
restart_cmd=restart
force_random=0
spf_record=0

View File

@@ -45,3 +45,4 @@ checkconf=named-checkconf
other_slaves=1
restart_cmd=restart
force_random=0
spf_record=0

View File

@@ -36,3 +36,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -42,3 +42,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -41,3 +41,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -42,3 +42,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -39,3 +39,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -41,3 +41,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -39,3 +39,4 @@ checkconf=named-checkconf
other_slaves=1
pid_file=/var/run/named/named.pid /private/var/run/named/named.pid
force_random=0
spf_record=0

View File

@@ -41,3 +41,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -41,3 +41,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -40,3 +40,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -40,3 +40,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -39,3 +39,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -40,3 +40,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -43,3 +43,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -40,3 +40,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -45,3 +45,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -45,3 +45,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -45,3 +45,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -41,3 +41,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -39,3 +39,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -41,3 +41,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -39,3 +39,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -39,3 +39,4 @@ signzone=/usr/bin/dnssec-signzone
checkconf=/usr/bin/named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -43,3 +43,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -44,3 +44,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -46,3 +46,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -45,3 +45,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -45,3 +45,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -45,3 +45,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -38,3 +38,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -41,3 +41,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -39,3 +39,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -56,3 +56,4 @@ signzone=dnssec-signzone
checkconf=named-checkconf
other_slaves=1
force_random=0
spf_record=0

View File

@@ -43,6 +43,7 @@ confirm_zone=Confirm before deleting zones?,1,1-Yes,0-No
confirm_rec=Confirm before deleting records?,1,1-Yes,0-No
free_nets=IP networks for free addresses,3,Automatic
force_random=Entropy source for DNSSEC keys,1,1-/dev/random (Secure but slow),0-/dev/urandom (Possibly insecure but fast)
spf_record=Real record type for Sender Permitted From,1,1-SPF,0-TXT
line2.5=Cluster slave servers,11
this_ip=Default master server IP for remote slave zones,3,IP address of hostname

View File

@@ -382,7 +382,7 @@ splice(@$lref, $_[1]->{'line'}, 1);
# Returns a string for some zone record
sub make_record
{
local $type = $_[3] eq "SPF" ? "TXT" : $_[3];
local $type = $_[3] eq "SPF" && !$config{'spf_record'} ? "TXT" : $_[3];
return $_[0] . ($_[1] ? "\t$_[1]" : "") . "\t$_[2]\t$type\t$_[4]" .
($_[5] ? "\t;$_[5]" : "");
}
@@ -710,15 +710,15 @@ foreach my $s ("a", "mx", "ip4", "ip6", "ptr", "include", "exists") {
}
}
push(@rv, @{$spf->{'other'}});
if ($spf->{'all'} == 3) { push(@rv, "-all"); }
elsif ($spf->{'all'} == 2) { push(@rv, "~all"); }
elsif ($spf->{'all'} == 1) { push(@rv, "?all"); }
elsif ($spf->{'all'} eq '0') { push(@rv, "all"); }
foreach my $m ("redirect", "exp") {
if ($spf->{$m}) {
push(@rv, $m."=".$spf->{$m});
}
}
if ($spf->{'all'} == 3) { push(@rv, "-all"); }
elsif ($spf->{'all'} == 2) { push(@rv, "~all"); }
elsif ($spf->{'all'} == 1) { push(@rv, "?all"); }
elsif ($spf->{'all'} eq '0') { push(@rv, "all"); }
local @rvwords;
local $rvword;
while(@rv) {