Return-Path: Received: by relay1.vsu.ru (CommuniGate Pro PIPE 5.3.14) with PIPE id 311417487; Sat, 18 Jun 2011 23:58:48 +0400 Received: from mail.taylortelephone.com ([70.89.198.97] verified) by relay1.vsu.ru (CommuniGate Pro SMTP 5.3.14) with ESMTPS id 311417484 for ai@vsu.ru; Sat, 18 Jun 2011 23:58:45 +0400 Received-SPF: pass receiver=relay1.vsu.ru; client-ip=70.89.198.97; envelope-from=jonnt@taylortelephone.com X-Virus-Scanned: by taylortelephone.com X-ExtFilter: Niversoft's DomainKeys Helper DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; d=taylortelephone.com; s=default; h=Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type; b=As3IexlHD5a7Ov2fx/1HY3U40r2wpCYJ/EffpaaWjJm1AoKCX5OW0UsLB9kgXmY7a5 y8PKR1ixRneL50MaxrKBY2V4l1SQ4oaVyyvXzBKAZCnGzRIBD+3+X3kzHV9t43IAhBzH +B11tjQvfh1z0x7akRR0A8/FQf98veV9sNO8Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=taylortelephone.com; s=default; l=4047; t=1308427410; x=1309032210; q=dns/txt; h=Message-ID:Date:From:User-Agent: MIME-Version:To:Subject:Content-Type; bh=SXD2kjgsuNJ7P7y4k2fTcc7 +N38d2efdBraPz0SeNPw=; b=qq+S6j8TAUl3ToynZhGXM9Owx8ij7p4KqSLbjG8 WdAk/fn3DSfqgdygzEUJPzb/gjGNrHDawtZH2znBj3kETW7eIwC6/Lw7QYBzccHU 35kvXuJqGbQOhcosawUJr2xIB0QPpGsG+SbaXOZdI9JqXuIOE4Yv6ng3sXBgXBQh hea0= Received: from [173.8.103.157] (account jonnt@taylortelephone.com HELO [192.168.183.3]) by taylortelephone.com (CommuniGate Pro SMTP 5.4.0) with ESMTPA id 6275718 for ai@vsu.ru; Sat, 18 Jun 2011 15:03:30 -0500 Message-ID: <4DFD047A.9070404@taylortelephone.com> Date: Sat, 18 Jun 2011 15:03:06 -0500 From: "Taylor, Jonn" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: Andy Igoshin Subject: Fwd: sa 3.3.1 patches Content-Type: multipart/mixed; boundary="------------000308060404070506080206" X-DrWeb-FlyTrap-Class: NON-SPAM X-DrWeb-FlyTrap-CID: 1 X-DrWeb-FlyTrap-ID: 6603175 This is a multi-part message in MIME format. --------------000308060404070506080206 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Andy, Here are the updated patches for Spamassassin 3.3.1 Jonn --------------000308060404070506080206 Content-Type: text/plain; name="Mail-SpamAssassin-3.3.1.sa-cgp.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="Mail-SpamAssassin-3.3.1.sa-cgp.diff" --- Mail-SpamAssassin-3.3.1.ORIG/lib/Mail/SpamAssassin/PerMsgStatus.pm 2011-06-18 14:09:35.000000000 -0500 +++ Mail-SpamAssassin-3.3.1/lib/Mail/SpamAssassin/PerMsgStatus.pm 2011-06-18 14:52:36.000000000 -0500 @@ -892,16 +892,20 @@ # skip the X-Spam- headers, but allow the X-Spam-Prev headers to remain. # since there may be a missing header/body # - my @pristine_headers = split(/^/m, $self->{msg}->get_pristine_header()); + my @pristine_headers; + my $separator = ''; + if ( !$self->{conf}->{headers_only} ) { + @pristine_headers = split(/^/m, $self->{msg}->get_pristine_header()); + for (my $line = 0; $line <= $#pristine_headers; $line++) { next unless ($pristine_headers[$line] =~ /^X-Spam-(?!Prev-)/i); splice @pristine_headers, $line, 1 while ($pristine_headers[$line] =~ /^(?:X-Spam-(?!Prev-)|[ \t])/i); $line--; } - my $separator = ''; if (@pristine_headers && $pristine_headers[$#pristine_headers] =~ /^\s*$/) { $separator = pop @pristine_headers; } + } my $addition = 'headers_ham'; @@ -957,6 +961,7 @@ # through the headers. my $new_hdrs_pre = ''; + my $new_hdrs_post = ''; if (@pristine_headers && $pristine_headers[0] =~ /^Return-Path:/i) { $new_hdrs_pre .= shift(@pristine_headers); while (@pristine_headers && $pristine_headers[0] =~ /^[ \t]/) { @@ -965,6 +970,10 @@ } $new_hdrs_pre .= $self->_get_added_headers($addition); + if ($self->{conf}->{headers_only}) { + return $new_hdrs_pre.$new_hdrs_post; + } + # fix up line endings appropriately my $newmsg = $new_hdrs_pre . join('',@pristine_headers) . $separator; $self->_fixup_report_line_endings(\$newmsg); @@ -972,6 +981,11 @@ return $newmsg.$self->{msg}->get_pristine_body(); } +sub headers_only { + my ($self) = @_; + $self->{conf}->{headers_only} = 1; +} + sub qp_encode_header { my ($self, $text) = @_; --- Mail-SpamAssassin-3.3.1.ORIG/spamc/libspamc.c 2011-06-18 14:09:35.000000000 -0500 +++ Mail-SpamAssassin-3.3.1/spamc/libspamc.c 2011-06-18 14:13:28.000000000 -0500 @@ -1114,6 +1114,8 @@ char *cp, *cpend, *bodystart; int bodylen, outspaceleft, towrite; + if (flags & SPAMC_NOBODY) return EX_OK; + /* at this stage, m->out now contains the rewritten headers. * find and append the raw message's body, up to m->priv->alloced_size * bytes. --- Mail-SpamAssassin-3.3.1.ORIG/spamc/libspamc.h 2011-06-18 14:09:35.000000000 -0500 +++ Mail-SpamAssassin-3.3.1/spamc/libspamc.h 2011-06-18 14:13:28.000000000 -0500 @@ -127,6 +127,7 @@ /* Jan 16, 2007 jm: get markup headers from spamd */ #define SPAMC_HEADERS (1<<15) +#define SPAMC_NOBODY (1<<14) /* December 5, 2007 duncf: send log messages to callback */ #define SPAMC_LOG_TO_CALLBACK (1<<14) --- Mail-SpamAssassin-3.3.1.ORIG/spamd/spamd.raw 2011-06-18 14:09:35.000000000 -0500 +++ Mail-SpamAssassin-3.3.1/spamd/spamd.raw 2011-06-18 14:13:28.000000000 -0500 @@ -1563,14 +1563,13 @@ $status->set_tag('REMOTEHOSTNAME', $remote_hostname); $status->set_tag('REMOTEHOSTADDR', $remote_hostaddr); - # Build the message to send back and measure it - my $msg_resp = $status->rewrite_mail(); - if ($method eq 'HEADERS') { - # just the headers; delete everything after first \015\012\015\012 - $msg_resp =~ s/(\015?\012\015?\012).*$/$1/gs; + $status->headers_only(); } + # Build the message to send back and measure it + my $msg_resp = $status->rewrite_mail(); + my $msg_resp_length = length($msg_resp); if ( $version >= 1.3 ) # Spamc protocol 1.3 means multi hdrs are OK --------------000308060404070506080206--