diff --git a/bind8/bind8-lib.pl b/bind8/bind8-lib.pl index 64a3cea58..9aba61203 100755 --- a/bind8/bind8-lib.pl +++ b/bind8/bind8-lib.pl @@ -1280,6 +1280,14 @@ elsif ($type eq "DMARC") { $ruf =~ s/^mailto://; print &ui_table_row($text{'value_dmarcruf'}, &ui_opt_textbox("dmarcruf", $ruf, 50, $text{'value_dmarcnor'}), 3); + + print &ui_table_row($text{'value_dmarcfo'}, + &ui_select("dmarcfo", $dmarc->{'fo'}, + [ [ undef, $text{'default'} ], + [ 0, $text{'value_dmarcfo0'} ], + [ 1, $text{'value_dmarcfo1'} ], + [ 'd', $text{'value_dmarcfod'} ], + [ 's', $text{'value_dmarcfos'} ] ])); } elsif ($type eq "NSEC3PARAM") { # NSEC records have a hash type, flags, number of interations, salt diff --git a/bind8/lang/en b/bind8/lang/en index b21c43d70..f0809620b 100644 --- a/bind8/lang/en +++ b/bind8/lang/en @@ -517,6 +517,11 @@ value_dmarcnop=Same as this domain value_dmarcaspf=Require strict SPF alignment value_dmarcadkim=Require strict DKIM alignment value_dmarcnor=Don't send +value_dmarcfo=Failure reporting mode +value_dmarcfo0=Report if DKIM and SPF failed +value_dmarcfo1=Report if either DKIM or SPF failed +value_dmarcfod=Report if signature evaluation failed +value_dmarcfos=Report if SPF evaluation failed value_CAA1=Require enforcement? value_CAA2=Authorization type value_CAA3=CA domain name diff --git a/bind8/records-lib.pl b/bind8/records-lib.pl index d4dc851f9..91d4e01a9 100755 --- a/bind8/records-lib.pl +++ b/bind8/records-lib.pl @@ -863,7 +863,7 @@ if ($txt =~ /^v=dmarc1/i) { my $dmarc = { }; foreach my $w (@w) { $w = lc($w); - if ($w =~ /^(v|pct|ruf|rua|p|sp|adkim|aspf)=(\S+)$/i) { + if ($w =~ /^(v|pct|ruf|rua|p|sp|adkim|aspf|fo)=(\S+)$/i) { $dmarc->{$1} = $2; } else { @@ -883,7 +883,7 @@ sub join_dmarc { my ($dmarc) = @_; my @rv = ( "v=DMARC1" ); -foreach my $s ("p", "pct", "ruf", "rua", "sp", "adkim", "aspf") { +foreach my $s ("p", "pct", "ruf", "rua", "sp", "adkim", "aspf", "fo") { if ($dmarc->{$s} && $dmarc->{$s} ne '') { push(@rv, $s."=".$dmarc->{$s}); } diff --git a/bind8/save_record.cgi b/bind8/save_record.cgi index f7967769d..6b79e9fbd 100755 --- a/bind8/save_record.cgi +++ b/bind8/save_record.cgi @@ -415,6 +415,13 @@ else { $dmarc->{'ruf'} = $in{'dmarcruf'}; } + if ($in{'dmarcfo'} eq '') { + delete($dmarc->{'fo'}); + } + else { + $dmarc->{'fo'} = $in{'dmarcfo'}; + } + $vals = "\"".&join_dmarc($dmarc)."\""; } elsif ($in{'type'} eq 'NSEC3PARAM') {