diff --git a/bind8/CHANGELOG b/bind8/CHANGELOG index 3999bcc2e..ca4f1f1b6 100644 --- a/bind8/CHANGELOG +++ b/bind8/CHANGELOG @@ -103,7 +103,8 @@ Fixed the 'Directory for DNSSEC keys' option on the Module Config page so that i SPF records longer than 255 bytes are automatically split into separate fields in the underlying TXT record. ---- Changes since 1.460 ---- When adding a master zone with automatically created slaves, add an also-notify block to the master configuration to update the slaves. ----- Changes since 1.480 ---- +---- Changes since 1.470 ---- Added mass record change and creation buttons to the zone search results page. Made the manual config file editor textboxes full-width. Fixed a bug that cause blocks like sortlist not be parsed properly, and possible cause Webmin to corrupt other parts of the named.conf file. +Redirect and explanation modifiers can be viewed and edited in SPF records. diff --git a/bind8/bind8-lib.pl b/bind8/bind8-lib.pl index 99e222cd9..a16bd2f29 100644 --- a/bind8/bind8-lib.pl +++ b/bind8/bind8-lib.pl @@ -1064,6 +1064,14 @@ elsif ($type eq "SPF") { [ 1, $text{'value_spfall1'} ], [ 0, $text{'value_spfall0'} ], [ undef, $text{'value_spfalldef'} ] ]), 3); + + print &ui_table_row($text{'value_spfredirect'}, + &ui_opt_textbox("spfredirect", $spf->{'redirect'}, 40, + $text{'value_spfnoredirect'}), 3); + + print &ui_table_row($text{'value_spfexp'}, + &ui_opt_textbox("spfexp", $spf->{'exp'}, 40, + $text{'value_spfnoexp'}), 3); } else { # All other types just have a text box diff --git a/bind8/lang/en b/bind8/lang/en index de5bfc98d..61de74bdb 100644 --- a/bind8/lang/en +++ b/bind8/lang/en @@ -277,6 +277,8 @@ edit_espfa='$1' is not a valid host to allow sending from edit_espfmx='$1' is not a valid domain name to allow MX sending from edit_espfip='$1' is not a valid IP address or IP/prefix to allow sending from edit_espfinclude='$1' is not a valid additional domain from which mail is sent +edit_espfredirect='$1' is not a valid alternate domain name +edit_espfexp='$1' is a valid record name for a rejection message text_title=Edit Records File text_title2=View Records File @@ -434,6 +436,10 @@ value_spfall2=Discourage (~all) value_spfall1=Neutral (?all) value_spfall0=Allow (+all) value_spfalldef=Default +value_spfredirect=Use SPF record from alternate domain +value_spfnoredirect=Use this domain's record +value_spfexp=TXT record for rejection reason +value_spfnoexp=None warn=Warn fail=Fail diff --git a/bind8/records-lib.pl b/bind8/records-lib.pl index e333bb3d5..d307c5167 100644 --- a/bind8/records-lib.pl +++ b/bind8/records-lib.pl @@ -670,6 +670,10 @@ if ($txt =~ /^v=spf1/) { elsif ($w eq "v=spf1") { # Ignore this } + elsif ($w =~ /^(redirect|exp)=(\S+)$/) { + # Modifier for domain redirect or expansion + $spf->{$1} = $2; + } else { push(@{$spf->{'other'}}, $w); } @@ -700,6 +704,11 @@ 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}); + } + } local @rvwords; local $rvword; while(@rv) { diff --git a/bind8/save_record.cgi b/bind8/save_record.cgi index ab6ee5ca7..d58198c59 100755 --- a/bind8/save_record.cgi +++ b/bind8/save_record.cgi @@ -305,6 +305,17 @@ else { &valname($i) || &error(&text('edit_espfinclude', $i)); } $spf->{'all'} = $in{'spfall'}; + foreach my $m ('redirect', 'exp') { + if ($in{'spf'.$m.'_def'}) { + delete($spf->{$m}); + } + else { + &valname($in{'spf'.$m}) || + &error(&text('edit_espf'.$m, + $in{'spf'.$m})); + $spf->{$m} = $in{'spf'.$m}; + } + } $vals = "\"".&join_spf($spf)."\""; } else {