[Amavisd-new-debian-devel] Plans for amavisd-new

Mark Martinec Mark.Martinec+amavis at ijs.si
Mon Sep 17 13:57:49 UTC 2007


Alex,
> I have most bugs fixed in the hg tree and plan to finish my work tomorrow
> (if nobody has objections) and upload 2.5.2 to experimental. I plan to
> migrate it to unstable as soon as possible if there are no big problems. It
> would be nice if anybody who has a little bit sparetime could give it some
> testing.
>
> I anybody has some special wishes - now is the time to say it :).

Please consider including the two fixes which I posted since 2.5.2.
I'll include the original postings below.

Regards
   Mark


From: Mark Martinec <Mark.Martinec+amavis at ijs.si>
To: amavis-user at lists.sourceforge.net
Date: Mon, 10 Sep 2007 02:19:40 +0200
Message-Id: <200709100219.40973.Mark.Martinec+amavis at ijs.si>
Subject: Re: [AMaViS-user] Long bad whitespace-lines - PATCH

everybody,

On Wednesday September 5 2007 03:53:44 Mark Martinec wrote:
> > I got one sample myself. It causes Perl process to exceed virtual memory
> > quota during evaluation of a regular expression in sub parse_received,
> > due to deep recursion. [...] I'll see what can be done better.
>
> Here is a better quick-fix, applies to 2.4.2 and later,
> including 2.5.*.  The 2.6.0-pre1 already includes this fix.

I came cross another sample, this time with a bad long From header field
with lots of spaces, which causes the same problem but in another code
section. Here is a new patch (includes the previously posted), please
apply it to 2.5.* to prevent badly broken mail (spam) from getting stuck
in a MTA queue:

--- amavisd.ori	Mon Sep 10 02:02:39 2007
+++ amavisd	Mon Sep 10 02:03:44 2007
@@ -3020,5 +3020,6 @@
   $received =~ s/\n([ \t])/$1/g;  # unfold
   $received =~ s/[\n\r]//g;       # delete remaining newlines if any
-  my(%fields);
+  $received =~ s/[ \t]+/ /g;      # compress whitespace as a quickfix/bandaid
+  my(%fields);                    #   for deep recursion in regexp evaluation
   while ($received =~ m{\G\s*
             ( \b(from|by) \s+ ( (?: \[ (?: \\. | [^\]\\] )* \] | [^;\s\[] )+ )
@@ -3308,7 +3309,7 @@
     $source_route = $1; $addr = $2;
   }
-  if ($addr =~ m{^ (    (?: [^"@]+ | " (?: \\. | [^"\\] )* " | . )*? )
-                   ( \@ (?: [^"@\[\]\\ \t]+ | \[ (?: \\. | [^\]\\] )* \]
-                          | [^@] )* )? \z}xs) {
+  if ($addr =~ m{^ ( .*? )
+                 ( \@ (?: [^@\[\]]+ | \[ (?: \\. | [^\]\\] )* \] | [^@] )* )?
+                 \z}xs) {
     ($localpart,$domain) = ($1,$2);
   } else {


Mark



From: Mark Martinec <Mark.Martinec+amavis at ijs.si>
To: mailzu-users at lists.sourceforge.net
Subject: Re: [Mailzu-users] Error when Releasing (NOT in FAQ)
Date: Thu, 9 Aug 2007 18:41:47 +0200
Message-Id: <200708091841.47625.Mark.Martinec+amavis at ijs.si>

Jeremy,

> It looks like its happening in this amavisd subroutine:
> Looks like this regular expression isn't catching the 250 response from the
> server and goes to the default else statement end replying with "450
> 4.5.0Unexpected:".

Right. It is a bug, triggered by those using versions of Postfix
before enhanced status codes were supported (RFC 2034, RFC 3463).

Here is a fix to amavisd-new 2.5.2:

--- amavisd.orig	Wed Jun 27 12:43:00 2007
+++ amavisd	Thu Aug  9 18:36:58 2007
@@ -13285,4 +13285,6 @@
     elsif ($resp =~ /^([1-5]\d\d) ([245]\.\d{1,3}\.\d{1,3})(?: |\z)(.*)\z/s)
       { ($smtp_s,$smtp_es,$msg) = ($1,$2,$3) }
+    elsif ($resp =~ /^(([1-5])\d\d)(?: |\z)(.*)\z/s)
+      { ($smtp_s,$smtp_es,$msg) = ($1, "$2.0.0" ,$3) }
     else
       { ($smtp_s,$smtp_es,$msg) = ('450', '4.5.0', "Unexpected: $resp") }

Please try it out.

  Mark



More information about the Amavisd-new-debian-devel mailing list