You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@spamassassin.apache.org by jm...@apache.org on 2009/09/21 05:30:25 UTC
svn commit: r817140 - in /spamassassin/trunk:
lib/Mail/SpamAssassin/Plugin/VBounce.pm
t.rules/BOUNCE_MESSAGE/fp_bug5912_att4322
Author: jm
Date: Mon Sep 21 03:30:24 2009
New Revision: 817140
URL: http://svn.apache.org/viewvc?rev=817140&view=rev
Log:
bug 5912: fix parsing of multi-line Received: headers for BOUNCE_MESSAGE/VBOUNCE_MESSAGE et al
Modified:
spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/VBounce.pm
spamassassin/trunk/t.rules/BOUNCE_MESSAGE/fp_bug5912_att4322
Modified: spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/VBounce.pm
URL: http://svn.apache.org/viewvc/spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/VBounce.pm?rev=817140&r1=817139&r2=817140&view=diff
==============================================================================
--- spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/VBounce.pm (original)
+++ spamassassin/trunk/lib/Mail/SpamAssassin/Plugin/VBounce.pm Mon Sep 21 03:30:24 2009
@@ -117,9 +117,25 @@
# fixed, otherwise we'll miss some messages due to their MIME structure
my $pristine = $pms->{msg}->get_pristine_body();
+ my $found_received = 0;
+ my $fullhdr = '';
foreach my $line ($pristine =~ /^(.*)$/gm) {
- next unless $line && ($line =~ /^[> ]*Received:/i);
- while ($line =~ / (\S+\.\S+) /g) {
+ if (!defined $line) { return 0; }
+
+ # don't bother until we see a line with "Received:" in it
+ if (!$found_received) {
+ next unless ($line =~ /^[> ]*Received:/i);
+ $found_received = 1;
+ }
+
+ if ($line =~ /^\s/) { # bug 5912, deal with multiline
+ $fullhdr .= $line;
+ } else {
+ $fullhdr = $line;
+ }
+
+ next unless ($fullhdr =~ /^[> ]*Received:/i);
+ while ($fullhdr =~ /\s(\S+\.\S+)\s/gs) {
return 1 if $self->_relay_is_in_whitelist_bounce_relays($pms, $1);
}
}
Modified: spamassassin/trunk/t.rules/BOUNCE_MESSAGE/fp_bug5912_att4322
URL: http://svn.apache.org/viewvc/spamassassin/trunk/t.rules/BOUNCE_MESSAGE/fp_bug5912_att4322?rev=817140&r1=817139&r2=817140&view=diff
==============================================================================
--- spamassassin/trunk/t.rules/BOUNCE_MESSAGE/fp_bug5912_att4322 (original)
+++ spamassassin/trunk/t.rules/BOUNCE_MESSAGE/fp_bug5912_att4322 Mon Sep 21 03:30:24 2009
@@ -1,5 +1,75 @@
-Received: from 10.100.0.101 (intmx02.mlsfinder.com [192.168.0.71])
- by mailgw02.wolfnettech.com (Postfix) with SMTP id 3E2479E5965
+Return-Path: <>
+Received: by mail.homes-magazine.com (CommuniGate Pro PIPE 5.0.14)
+ with PIPE id 3346853; Fri, 16 May 2008 10:49:38 -0700
+X-TFF-CGPSA-Version: 1.5
+X-TFF-CGPSA-Filter: Scanned
+X-Spam-Checker-Version: SpamAssassin 3.2.4 (2008-01-01) on
+ apollo.homes-magazine.com
+X-Spam-Level:
+X-Spam-Status: No, score=0.4 required=5.0 tests=ANY_BOUNCE_MESSAGE,AWL,
+ BAYES_00,BOUNCE_MESSAGE,HTML_MESSAGE,RAZOR2_CF_RANGE_51_100,
+ RAZOR2_CF_RANGE_E4_51_100,RAZOR2_CHECK,TVD_FW_GRAPHIC_NAME_MID autolearn=no
+ version=3.2.4
+Received: from mailgw02.wolfnettech.com ([216.17.53.37] verified)
+ by mail.homes-magazine.com (CommuniGate Pro SMTP 5.0.14)
+ with ESMTP id 3346851 for webcare@homesmagazine.com; Fri, 16 May 2008 10:49:21 -0700
+Received: by mailgw02.wolfnettech.com (Postfix)
+ id B89E29E5968; Fri, 16 May 2008 12:48:50 -0500 (CDT)
+Date: Fri, 16 May 2008 12:48:50 -0500 (CDT)
+From: MAILER-DAEMON@mailgw02.wolfnettech.com (Mail Delivery System)
+Subject: Undelivered Mail Returned to Sender
+To: webcare@homesmagazine.com
+Auto-Submitted: auto-replied
+MIME-Version: 1.0
+Content-Type: multipart/report; report-type=delivery-status;
+ boundary="3E2479E5965.1210960130/mailgw02.wolfnettech.com"
+Message-Id: <20...@mailgw02.wolfnettech.com>
+
+This is a MIME-encapsulated message.
+
+--3E2479E5965.1210960130/mailgw02.wolfnettech.com
+Content-Description: Notification
+Content-Type: text/plain; charset=us-ascii
+
+This is the mail system at host mailgw02.wolfnettech.com.
+
+I'm sorry to have to inform you that your message could not
+be delivered to one or more recipients. It's attached below.
+
+For further assistance, please send mail to <postmaster>
+
+If you do so, please include this problem report. You can
+delete your own text from the attached returned message.
+
+ The mail system
+
+<wl...@pacbell.net>: host pbimail5.prodigy.net[207.115.36.20] said: 553 5.3.0
+ <wl...@pacbell.net>... Addressee unknown, relay=[216.17.53.37] (in reply
+ to RCPT TO command)
+
+--3E2479E5965.1210960130/mailgw02.wolfnettech.com
+Content-Description: Delivery report
+Content-Type: message/delivery-status
+
+Reporting-MTA: dns; mailgw02.wolfnettech.com
+X-Postfix-Queue-ID: 3E2479E5965
+X-Postfix-Sender: rfc822; webcare@homesmagazine.com
+Arrival-Date: Fri, 16 May 2008 12:48:50 -0500 (CDT)
+
+Final-Recipient: rfc822; wlycnh1@pacbell.net
+Original-Recipient: rfc822;wlycnh1@pacbell.net
+Action: failed
+Status: 5.3.0
+Remote-MTA: dns; pbimail5.prodigy.net
+Diagnostic-Code: smtp; 553 5.3.0 <wl...@pacbell.net>... Addressee unknown,
+ relay=[216.17.53.37]
+
+--3E2479E5965.1210960130/mailgw02.wolfnettech.com
+Content-Description: Undelivered Message
+Content-Type: message/rfc822
+
+Received: from 10.100.0.101 (intmx02.mlsfinder.com [192.168.0.71]) by
+ mailgw02.wolfnettech.com (Postfix) with SMTP id 3E2479E5965
for <wl...@pacbell.net>; Fri, 16 May 2008 12:48:50 -0500 (CDT)
From: <we...@homesmagazine.com>
To: <wl...@pacbell.net>
@@ -83,3 +153,5 @@
------=_NextPart_06794765_377CEB575348A058--
+
+--3E2479E5965.1210960130/mailgw02.wolfnettech.com--