You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by si...@apache.org on 2005/11/23 20:22:18 UTC

svn commit: r348522 - in /spamassassin/branches/3.1: lib/Mail/SpamAssassin/Message/Metadata/Received.pm t/rcvd_parser.t

Author: sidney
Date: Wed Nov 23 11:22:12 2005
New Revision: 348522

URL: http://svn.apache.org/viewcvs?rev=348522&view=rev
Log:
bug4686: Fix a case in Received header parsing

Modified:
    spamassassin/branches/3.1/lib/Mail/SpamAssassin/Message/Metadata/Received.pm
    spamassassin/branches/3.1/t/rcvd_parser.t

Modified: spamassassin/branches/3.1/lib/Mail/SpamAssassin/Message/Metadata/Received.pm
URL: http://svn.apache.org/viewcvs/spamassassin/branches/3.1/lib/Mail/SpamAssassin/Message/Metadata/Received.pm?rev=348522&r1=348521&r2=348522&view=diff
==============================================================================
--- spamassassin/branches/3.1/lib/Mail/SpamAssassin/Message/Metadata/Received.pm (original)
+++ spamassassin/branches/3.1/lib/Mail/SpamAssassin/Message/Metadata/Received.pm Wed Nov 23 11:22:12 2005
@@ -933,6 +933,20 @@
     if (/^from (\S+) \((?:\S+\@)?(${IP_ADDRESS})\) by (\S+) with /) {
       $rdns = $1; $ip = $2; $by = $3; goto enough;
     }
+
+    # Obtuse smtpd: http://www.obtuse.com/
+    # Received: from TCE-E-7-182-54.bta.net.cn(202.106.182.54) via SMTP
+    #  by st.tahina.priv.at, id smtpdEDUB8h; Sun Nov 13 14:50:12 2005
+    # Received: from pl027.nas934.d-osaka.nttpc.ne.jp(61.197.82.27), claiming to be "foo.woas.net" via SMTP
+    #  by st.tahina.priv.at, id smtpd1PBsZT; Sun Nov 13 15:38:52 2005
+    if (/^from (\S+)\((${IP_ADDRESS})\)(?:, claiming to be "(\S+)")? via \S+ by (\S+),/) {
+      $rdns = $1; $ip = $2; $helo = (defined $3) ? $3 : ''; $by = $4;
+      if ($1 ne 'UNKNOWN') {
+	$mta_looked_up_dns = 1;
+	$rdns = $1;
+      }
+      goto enough;
+    }
   }
 
   # simta: http://rsug.itd.umich.edu/software/simta/

Modified: spamassassin/branches/3.1/t/rcvd_parser.t
URL: http://svn.apache.org/viewcvs/spamassassin/branches/3.1/t/rcvd_parser.t?rev=348522&r1=348521&r2=348522&view=diff
==============================================================================
--- spamassassin/branches/3.1/t/rcvd_parser.t (original)
+++ spamassassin/branches/3.1/t/rcvd_parser.t Wed Nov 23 11:22:12 2005
@@ -18,7 +18,7 @@
 
 use lib '.'; use lib 't';
 use SATest; sa_t_init("rcvd_parser");
-use Test; BEGIN { plan tests => 45 };
+use Test; BEGIN { plan tests => 46 };
 
 
 use strict;
@@ -577,6 +577,17 @@
 } => q{
 
   [ ip=141.211.14.81 rdns=smtp.mail.umich.edu helo=hackers.mr.itd.umich.edu by=madman.mr.itd.umich.edu ident= envfrom= id=434B508E.174A6.13932 auth= ] [ ip=64.233.216.90 rdns=s233-64-90-216.try.wideopenwest.com helo=!192.168.1.24! by=hackers.mr.itd.umich.edu ident= envfrom= id=434B5051.8CDE5.15436 auth= ]
+
+},
+q{
+
+Received: from TCE-E-7-182-54.bta.net.cn(202.106.182.54) via SMTP
+	by st.tahina.priv.at, id smtpdEDUB8h; Sun Nov 13 14:50:12 2005
+Received: from pl027.nas934.d-osaka.nttpc.ne.jp(61.197.82.27), claiming to be "foo.woas.net" via SMTP
+	by st.tahina.priv.at, id smtpd1PBsZT; Sun Nov 13 15:38:52 2005
+} => q{
+
+  [ ip=202.106.182.54 rdns=TCE-E-7-182-54.bta.net.cn helo= by=st.tahina.priv.at ident= envfrom= id=smtpdEDUB8h auth= ] [ ip=61.197.82.27 rdns=pl027.nas934.d-osaka.nttpc.ne.jp helo=foo.woas.net by=st.tahina.priv.at ident= envfrom= id=smtpd1PBsZT auth= ]
 
 }
 );