You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by do...@apache.org on 2006/06/25 04:11:16 UTC
svn commit: r416977 - in /spamassassin/trunk:
lib/Mail/SpamAssassin/Message/Metadata/Received.pm t/rcvd_parser.t
Author: dos
Date: Sat Jun 24 19:11:16 2006
New Revision: 416977
URL: http://svn.apache.org/viewvc?rev=416977&view=rev
Log:
bug 4943: parse Norton AntiVirus Gateway received headers
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata/Received.pm
spamassassin/trunk/t/rcvd_parser.t
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata/Received.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata/Received.pm?rev=416977&r1=416976&r2=416977&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata/Received.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata/Received.pm Sat Jun 24 19:11:16 2006
@@ -381,7 +381,8 @@
# Received: (qmail 84907 invoked from network); 13 Feb 2003 20:59:28 -0000
# Received: (ofmipd 208.31.42.38); 17 Mar 2003 04:09:01 -0000
# we don't care about this kind of gateway noise
- if (/^\(/) { return; }
+ # Bug 4943: give /^(from/ a chance to be parsed
+ if (/^\((?!from)/) { return; }
# OK -- given knowledge of most Received header formats,
# break them down. We have to do something like this, because
@@ -1004,6 +1005,15 @@
$helo = $1; $rdns = $2; $ip = $3; $by = $4;
$id = $5 if (defined $5);
goto enough;
+ }
+
+ # Norton AntiVirus Gateway
+ # Received: (from localhost [24.180.47.240])
+ # by host.name (NAVGW 2.5.2.12) with SMTP id M2006060503484615455
+ # for <us...@domain.co.uk>; Mon, 05 Jun 2006 03:48:47 +0100
+ if (/^\(from (\S*) \[(${IP_ADDRESS})\]\) by (\S+) \(NAVGW .*?\) with /) {
+ $helo = $1; $ip = $2; $by = $3;
+ goto enough;
}
# ------------------------------------------------------------------------
Modified: spamassassin/trunk/t/rcvd_parser.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/rcvd_parser.t?rev=416977&r1=416976&r2=416977&view=diff
==============================================================================
--- spamassassin/trunk/t/rcvd_parser.t (original)
+++ spamassassin/trunk/t/rcvd_parser.t Sat Jun 24 19:11:16 2006
@@ -18,7 +18,7 @@
use lib '.'; use lib 't';
use SATest; sa_t_init("rcvd_parser");
-use Test; BEGIN { plan tests => 48 };
+use Test; BEGIN { plan tests => 49 };
use strict;
@@ -608,6 +608,17 @@
} => q{
[ ip=66.0.37.1 rdns= helo=Amazon.com by=bi-staff1.beckman.uiuc.edu ident= envfrom= intl=0 id=k1SCIR87017358 auth= ]
+
+},
+q{
+
+Received: (from KRYPTIK [70.20.57.51])
+ by host.name (NAVGW 2.5.2.12) with SMTP id M2006040415284308595
+ for <us...@domain.co.uk>; Tue, 04 Apr 2006 15:28:45 +0100
+
+} => q{
+
+[ ip=70.20.57.51 rdns= helo=KRYPTIK by=host.name ident= envfrom= id=M2006040415284308595 auth= ]
},
);