This is a discussion on Re: [AMaViS-user] Long bad whitespace-lines - PATCH within the Amavis User forums, part of the Anti-Spam and Anti-Virus Related Forums category; everybody, On Wednesday September 5 2007 03:53:44 Mark Martinec wrote: > > I got one sample myself. It ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ AMaViS-user mailing list AMaViS-user@lists.sourceforge.net https://lists.sourceforge.net/lists/...fo/amavis-user AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3 AMaViS-HowTos:http://www.amavis.org/howto/ |
![]() |
| Thread Tools | |
| Display Modes | |
|
|