Subject: | Add support for SPF records |
When a domain contains records of the SPF type (99) as defined by RFC
4408 [1], the parser responds in the following warning and is not
included in any output.
Unparseable line (Unknown record type)
@ IN SPF "v=spf1 mx -all"
Attached is a patch that allows these SPF records to be used. The only
verification that they are the correct format is the check of a version
tag of "v=spf1". More detail could be given to check whether correct
mechanisms are used.
This patch has been tested against perl running on debian wheezy, and
the diff is against the 1.10 source obtained from CPAN.
Also, may be another bug. I would suggest that any records that fail to
parse should be stored in a separate section in the parser that can't be
modified (easily?) and is output when required. This allows new record
types to still be used in output, while not being able to be manipulated
(easily..).
Cheers,
Hugh
[1] http://tools.ietf.org/html/rfc4408
Subject: | spf.patch |
24c24
< %dns_generate,
---
> %dns_generate, %dns_spf,
81a82
> delete $dns_spf{$self};
108a110
> : $method eq 'spf' ? $dns_spf{$self}
136a139
> SPF => $dns_spf{$self},
277a281,286
> foreach my $o ( @{ $dns_spf{$self} } ) {
> next unless defined $o;
> next unless $o->{'ORIGIN'} eq $process_this_origin;
> $self->_escape_chars( $o );
> $output .= qq[$o->{name} $o->{ttl} $o->{class} SPF "$o->{text}"\n];
> }
370a380
> $dns_spf{$self} = [];
730a741,754
> } elsif (
> /($valid_name)? \s+
> $ttl_cls
> SPF \s+
> ("v=spf1\s($valid_quoted_txt_char*(?<!\\)"|$valid_txt_char+))
> /ixo
> ) {
> push @{ $dns_spf{$self} },
> $self->_massage( {
> name => $1,
> ttl => $2,
> class => $3,
> text => $4,
> } );