https://issues.apache.org/SpamAssassin/show_bug.cgi?id=5878

           Summary: IPV4_ADDRESS regexp matches ip.ad.dr.in-addr.arpa format
           Product: Spamassassin
           Version: 3.2.4
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P5
         Component: Libraries
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Hi, via some recent testing. I saw that RCVD_NUMERIC_HELO was being fired when
the   helo detected by SA was of the form a.b.c.d.in-adddr.arpa (where a.b.c.d)
was an ip address in reverse octect form

I wrote the following test case which uses the constant IPV4_ADDRESS from the
SA source to show this behaviour. 

#!/usr/bin/perl

use strict;
use warnings;
use Test::More tests => 1;

use constant IPV4_ADDRESS => qr/\b
                    (?:1\d\d|2[0-4]\d|25[0-5]|\d\d|\d)\.
                    (?:1\d\d|2[0-4]\d|25[0-5]|\d\d|\d)\.
                    (?:1\d\d|2[0-4]\d|25[0-5]|\d\d|\d)\.
                    (?:1\d\d|2[0-4]\d|25[0-5]|\d\d|\d)
                  \b/ox;

sub check_ipv4 {
   my ($rcvd) = @_ ;
   my $IP_ADDRESS = IPV4_ADDRESS;
   if ($rcvd =~ /helo=($IP_ADDRESS)\b/i) {
     return 1;
   }
   return 0;
}

my $helostring = "helo=242.8.168.192.in-addr.arpa";

ok(check_ipv4($helostring) == 1);


-- 
Configure bugmail: 
https://issues.apache.org/SpamAssassin/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

Reply via email to