You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by mm...@apache.org on 2009/11/25 19:08:16 UTC
svn commit: r884223 - in /spamassassin/trunk:
lib/Mail/SpamAssassin/Message/Metadata/Received.pm t/rcvd_parser.t
Author: mmartinec
Date: Wed Nov 25 18:08:16 2009
New Revision: 884223
URL: http://svn.apache.org/viewvc?rev=884223&view=rev
Log:
Bug 5883 - support for Communigate Pro 'Received' header field;
folded-in all supplied test cases into t/rcvd_parser.t
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=884223&r1=884222&r2=884223&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata/Received.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Message/Metadata/Received.pm Wed Nov 25 18:08:16 2009
@@ -260,7 +260,7 @@
$self->{msg}->delete_header ("X-Spam-Relays-Untrusted");
$self->{msg}->delete_header ("X-Spam-Relays-Internal");
$self->{msg}->delete_header ("X-Spam-Relays-External");
-
+
if ($self->{msg}->can ("put_metadata")) {
$self->{msg}->put_metadata ("X-Spam-Relays-Trusted",
$self->{relays_trusted_str});
@@ -408,6 +408,10 @@
elsif (/\) \(Authenticated sender: \S+\) by \S+ \(Postfix\) with /) {
$auth = 'Postfix';
}
+ # Communigate Pro
+ elsif (/CommuniGate Pro SMTP/ && / \(account /) {
+ $auth = 'Communigate';
+ }
# ---------------------------------------------------------------------------
@@ -938,6 +942,14 @@
$ip = $1; $helo = $2; $by = $3; goto enough;
}
+ # Received: from host.example.com ([192.0.2.1] verified)
+ # by mail.example.net (CommuniGate Pro SMTP 5.1.13)
+ # with ESMTP id 9786656 for user@example.net; Thu, 27 Mar 2008 15:08:17 +0600
+ if (/ \(CommuniGate Pro/ && /^(\S+) \(\[(${IP_ADDRESS})\] verified\) by (\S+) \(/) {
+ $mta_looked_up_dns = 1;
+ $rdns = $1; $helo = $1; $ip = $2; $by = $3; goto enough;
+ }
+
# Received: from ([10.0.0.6]) by mail0.ciphertrust.com with ESMTP ; Thu,
# 13 Mar 2003 06:26:21 -0500 (EST)
if (/^\(\[(${IP_ADDRESS})\]\) by (\S+) with /) {
Modified: spamassassin/trunk/t/rcvd_parser.t
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t/rcvd_parser.t?rev=884223&r1=884222&r2=884223&view=diff
==============================================================================
--- spamassassin/trunk/t/rcvd_parser.t (original)
+++ spamassassin/trunk/t/rcvd_parser.t Wed Nov 25 18:08:16 2009
@@ -18,7 +18,7 @@
use lib '.'; use lib 't';
use SATest; sa_t_init("rcvd_parser");
-use Test; BEGIN { plan tests => 133 };
+use Test; BEGIN { plan tests => 141 };
use strict;
# format is:
@@ -222,7 +222,7 @@
'[ ip=207.213.27.129 rdns=adsl-207-213-27-129.dsl.lsan03.pacbell.net helo=merlin.net.au by=totor.example.net ident=Owner50 envfrom= id= auth= msa=0 ]',
'from imo-m01.mx.aol.com ([64.12.136.4] verified) by xxx.com (CommuniGate Pro SMTP 4.1.8) with ESMTP id 875522 for yyy@xxx.com; Tue, 03 Feb 2004 08:37:38 -0800' =>
- '[ ip=64.12.136.4 rdns= helo=imo-m01.mx.aol.com by=xxx.com ident= envfrom= id=875522 auth= msa=0 ]',
+ '[ ip=64.12.136.4 rdns=imo-m01.mx.aol.com helo=imo-m01.mx.aol.com by=xxx.com ident= envfrom= id=875522 auth= msa=0 ]',
'from [65.17.198.50] (HELO 123greetings.info) by mail.wcg.org (CommuniGate Pro SMTP 5.1.3) with SMTP id 19467966 for xxxx@wcg.org; Fri, 08 Dec 2006 08:40:46 -0800' =>
'[ ip=65.17.198.50 rdns= helo=123greetings.info by=mail.wcg.org ident= envfrom= id=19467966 auth= msa=0 ]',
@@ -428,7 +428,35 @@
# bug 6239
'from [1.2.3.4] (account user@example.com) by webmail.example.com (CommuniGate Pro XIMSS 5.2.16) with HTTPU id 87581547 for user@example.org; Thu, 19 Nov 2009 20:08:10 -0500' =>
- '[ ip=1.2.3.4 rdns= helo= by=webmail.example.com ident= envfrom= id=87581547 auth=HTTPU msa=0 ]'
+ '[ ip=1.2.3.4 rdns= helo= by=webmail.example.com ident= envfrom= id=87581547 auth=HTTPU msa=0 ]',
+
+ # bug 5883
+ 'from mail.tonet.ru ([213.183.114.1] verified) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.13) with ESMTPS id 9837783 for hostmaster@ns.tomsk.ru; Tue, 08 Apr 2008 13:14:35 +0700' =>
+ '[ ip=213.183.114.1 rdns=mail.tonet.ru helo=mail.tonet.ru by=relay2.tomsk.ru ident= envfrom= id=9837783 auth= msa=0 ]',
+
+ 'from dedic5.cmspanel.ru ([83.222.3.95] verified) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.13) with ESMTPS id 9837912 for hostmaster@ns.tomsk.ru; Tue, 08 Apr 2008 13:39:27 +0700' =>
+ '[ ip=83.222.3.95 rdns=dedic5.cmspanel.ru helo=dedic5.cmspanel.ru by=relay2.tomsk.ru ident= envfrom= id=9837912 auth= msa=0 ]',
+
+ 'from sibmail.com ([77.106.108.226] verified) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.13) with ESMTPS id 9834928 for sudakov@sibptus.tomsk.ru; Mon, 07 Apr 2008 22:49:05 +0700' =>
+ '[ ip=77.106.108.226 rdns=sibmail.com helo=sibmail.com by=relay2.tomsk.ru ident= envfrom= id=9834928 auth= msa=0 ]',
+
+ 'from [78.140.15.96] (HELO relay4.kvadro.net) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.13) with ESMTPS id 9843045 for hostmaster@ns.tomsk.ru; Wed, 09 Apr 2008 02:31:33 +0700' =>
+ '[ ip=78.140.15.96 rdns= helo=relay4.kvadro.net by=relay2.tomsk.ru ident= envfrom= id=9843045 auth= msa=0 ]',
+
+ 'from [78.140.0.68] (HELO mail.tomica.ru) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.13) with ESMTP id 9837455 for hostmaster@ns.tomsk.ru; Tue, 08 Apr 2008 12:12:52 +0700' =>
+ '[ ip=78.140.0.68 rdns= helo=mail.tomica.ru by=relay2.tomsk.ru ident= envfrom= id=9837455 auth= msa=0 ]',
+
+ 'from [88.204.72.252] (HELO tusur.ru) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.13) with ESMTPS id 9823077 for hostmaster@ns.tomsk.ru; Fri, 04 Apr 2008 09:26:16 +0700' =>
+ '[ ip=88.204.72.252 rdns= helo=tusur.ru by=relay2.tomsk.ru ident= envfrom= id=9823077 auth= msa=0 ]',
+
+ 'from [78.139.216.10] (HELO org-tms01.org.yukos.ru) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.13) with SMTP id 9479501 for hostmaster@ns.tomsk.su; Wed, 26 Dec 2007 18:33:28 +0600' =>
+ '[ ip=78.139.216.10 rdns= helo=org-tms01.org.yukos.ru by=relay2.tomsk.ru ident= envfrom= id=9479501 auth= msa=0 ]',
+
+ 'from [212.73.124.190] (account skudinva@sibptus.tomsk.ru HELO wxpskudinva.sibptus.transneft.ru) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.13) with ESMTPSA id 9830625 for sudakov@sibptus.tomsk.ru; Mon, 07 Apr 2008 08:42:48 +0700' =>
+ '[ ip=212.73.124.190 rdns= helo=wxpskudinva.sibptus.transneft.ru by=relay2.tomsk.ru ident= envfrom= id=9830625 auth=ESMTPSA msa=0 ]',
+
+# 'from docsis-77-106-72-91.tomtelnet.ru (account moskalenko@postbox.tomsk.ru [77.106.72.91] verified) by relay2.tomsk.ru (CommuniGate Pro SMTP 5.1.13) with ESMTPSA id 9828571 for hostmaster@ns.tomsk.ru; Sun, 06 Apr 2008 04:00:16 +0700' =>
+# '[ ip=77.106.72.91 rdns=docsis-77-106-72-91.tomtelnet.ru helo=docsis-77-106-72-91.tomtelnet.ru by=relay2.tomsk.ru ident= envfrom= id=9828571 auth=ESMTPSA msa=0 ]',
);