You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2005/12/19 08:27:16 UTC

svn commit: r357661 - /spamassassin/branches/3.1/lib/Mail/SpamAssassin/DnsResolver.pm

Author: jm
Date: Sun Dec 18 23:27:13 2005
New Revision: 357661

URL: http://svn.apache.org/viewcvs?rev=357661&view=rev
Log:
bug 4719: long paragraphs should be split on word boundaries where possible

Modified:
    spamassassin/branches/3.1/lib/Mail/SpamAssassin/DnsResolver.pm

Modified: spamassassin/branches/3.1/lib/Mail/SpamAssassin/DnsResolver.pm
URL: http://svn.apache.org/viewcvs/spamassassin/branches/3.1/lib/Mail/SpamAssassin/DnsResolver.pm?rev=357661&r1=357660&r2=357661&view=diff
==============================================================================
--- spamassassin/branches/3.1/lib/Mail/SpamAssassin/DnsResolver.pm (original)
+++ spamassassin/branches/3.1/lib/Mail/SpamAssassin/DnsResolver.pm Sun Dec 18 23:27:13 2005
@@ -225,7 +225,7 @@
 
 =item $packet = new_dns_packet ($host, $type, $class)
 
-A wrapper for C<Net::DNS::Packet::new()> which traps a die thrown by it
+A wrapper for C<Net::DNS::Packet::new()> which traps a die thrown by it.
 
 To use this, change calls to C<Net::DNS::Resolver::bgsend> from:
 
@@ -241,6 +241,12 @@
   my ($self, $host, $type, $class) = @_;
 
   return if $self->{no_resolver};
+
+  # construct a PTR query if it looks like an IPv4 address
+  if ((!defined($type) || $type eq 'PTR') && $host =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) {
+    $host = "$4.$3.$2.$1.in-addr.arpa.";
+    $type = 'PTR';
+  }
 
   my $packet;
   eval {



Re: svn commit: r357661 - /spamassassin/branches/3.1/lib/Mail/SpamAssassin/DnsResolver.pm

Posted by Sidney Markowitz <si...@sidney.com>.
Theo Van Dinter wrote:
> Errr.  Me thinks the patch committed is not what was intended...

All fixed up :-)

 -- sidney

Re: svn commit: r357661 - /spamassassin/branches/3.1/lib/Mail/SpamAssassin/DnsResolver.pm

Posted by Theo Van Dinter <fe...@apache.org>.
Errr.  Me thinks the patch committed is not what was intended...

On Mon, Dec 19, 2005 at 07:27:16AM -0000, jm@apache.org wrote:
> bug 4719: long paragraphs should be split on word boundaries where possible
> 
> Modified:
>     spamassassin/branches/3.1/lib/Mail/SpamAssassin/DnsResolver.pm
> 
[...]
> -A wrapper for C<Net::DNS::Packet::new()> which traps a die thrown by it
> +A wrapper for C<Net::DNS::Packet::new()> which traps a die thrown by it.
[...]
> +  # construct a PTR query if it looks like an IPv4 address
> +  if ((!defined($type) || $type eq 'PTR') && $host =~ /^(\d+)\.(\d+)\.(\d+)\.(\d+)$/) {
> +    $host = "$4.$3.$2.$1.in-addr.arpa.";
> +    $type = 'PTR';
> +  }

-- 
Randomly Generated Tagline:
"I don't think Microsoft is evil in itself; I just think they make really
 crappy operating systems."            - Linus Torvalds