[prev in list] [next in list] [prev in thread] [next in thread] 

List:       spamassassin-devel
Subject:    [Bug 7078] New: Mail::Spamassassin::Message::Node::header() error.
From:       bugzilla-daemon () bugzilla ! spamassassin ! org
Date:       2014-08-22 7:00:07
Message-ID: bug-7078-26 () https ! issues ! apache ! org/SpamAssassin/
[Download RAW message or body]

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

            Bug ID: 7078
           Summary: Mail::Spamassassin::Message::Node::header() error.
           Product: Spamassassin
           Version: 3.4.0
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: major
          Priority: P2
         Component: spamassassin
          Assignee: dev@spamassassin.apache.org
          Reporter: liu31380@gmail.com

Created attachment 5231
  --> https://issues.apache.org/SpamAssassin/attachment.cgi?id=5231&action=edit
DATE_IN_PAST_96_XX

I take one mail (attachment), report following rule.

"2.1 DATE_IN_PAST_96_XX     Date: is 96 hours or more before Received: date"

I try to debug  the code , traced in Mail::Spamassassin::Message::Node::header
procedure , I insert print line to debug "received" field's pasering
result(modifyed code).

The result display:
---------------
 from smtp.test.com ([120.1.1.120])
        by mail.cutlass.com (IceWarp 9.4.2) with SMTP id IPY03927
        for <admin@cutlass.com>; Tue, 22 Jul 2014 16:54:27 +0800

---------------
---------------
 for <admin@cutlass.com>; Tue, 22 Jul 2014 16:54:27 +08007

---------------
---------------
 from yangzhengchu (192.168.179.243) by smtp.isof.com
 (192.168.2.142) with Microsoft SMTP Server (TLS) id 14.2.247.3; Sat, 27 Apr
 2013 15:38:17 +0800

---------------
---------------
 2013 15:38:17 +0800h Microsoft SMTP Server (TLS) id 14.2.247.3; Sat, 27 Apr

---------------

================modifyed code================
sub header {
  my $self   = shift;
  my $rawkey = shift;

  return unless defined $rawkey;

  # we're going to do things case insensitively
  my $key    = lc($rawkey);

  # Trim whitespace off of the header keys
  $key       =~ s/^\s+//;
  $key       =~ s/\s+$//;

  if (@_) {
    my $raw_value = shift;
    return unless defined $raw_value;

    push @{ $self->{'header_order'} }, $rawkey;
    if ( !exists $self->{'headers'}->{$key} ) {
      $self->{'headers'}->{$key} = [];
      $self->{'raw_headers'}->{$key} = [];
    }

    my $dec_value = $raw_value;
        if($key eq "received") {                                                
        print "---------------\n";                                              
        print $dec_value."\n";                                                  
        print "---------------\n";                                              
    }
    $dec_value =~ s/\n[ \t]+/ /gs;
        if($key eq "received") {                                                
        print "---------------\n";                                              
        print $dec_value."\n";                                                  
        print "---------------\n";                                              
    }
    $dec_value =~ s/\s+$//s;
    $dec_value =~ s/^\s+//s;
    push @{ $self->{'headers'}->{$key} },
$self->_decode_header($dec_value,$key);

    push @{ $self->{'raw_headers'}->{$key} }, $raw_value;

    return $self->{'headers'}->{$key}->[-1];
  }

  if (wantarray) {
    return unless exists $self->{'headers'}->{$key};
    return @{ $self->{'headers'}->{$key} };
  }
  else {
    return '' unless exists $self->{'headers'}->{$key};
    return $self->{'headers'}->{$key}->[-1];
  }
}

-- 
You are receiving this mail because:
You are the assignee for the bug.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic