Sébastien,

> My gzip file has been sent personally to Mark Martinec because I had a
> problem with sending it to the mailing list.
> The log file I sent in my previous message was with disabling berkeleydb
> and applying patch. I hope it will able to help you.

Thanks. It took me a while to be able to reproduce the problem - it turned
out that it was already partially fixed in my current 2.6.0 code, but I could
devise some additional obscure cases which needed to be addresses as well).

Here is a combined patch against a pristine 2.5.3 (the patch includes a
backport of sub parse_address, as mentioned previously in this thread).


--- amavisd.orig        2008-01-28 20:29:31.000000000 +0100
+++ amavisd     2008-02-27 21:04:16.000000000 +0100
@@ -3154,5 +3154,5 @@
 sub split_address($) {
   my($mailbox) = @_;  local($1,$2);
-  $mailbox =~ /^ (.*?) ( \@ (?:  \[  (?: \\. | [^\]\\] )*  (?: \] | \z)
+  $mailbox =~ /^ (.*?) ( \@ (?:  \[  (?: \\. | [^\]\\] ){0,999} (?: \] | \z)
                               |  [EMAIL PROTECTED] )*
                        ) \z/xs ? ($1, $2) : ($mailbox, '');
@@ -3352,7 +3352,6 @@
   # the angle-bracket stripping is not really a duty of this subroutine,
   # as it should have been already done elsewhere, but we allow it here anyway:
-  local($1,$2);
-  $addr = $1  if $addr =~ /^ \s* < ( .* ) > \s* \z/xs;
-  my($source_route,$localpart,$domain) = ('','','');
+  $addr =~ s/^\s*<//s;  $addr =~ s/>\s*\z//s;  # tolerate unmatched angle brkts
+  local($1,$2); my($source_route,$localpart,$domain) = ('','','');
   # RFC 2821: so-called "source route" MUST BE accepted,
   #           SHOULD NOT be generated, and SHOULD be ignored.
@@ -3362,7 +3361,7 @@
   if (index($addr,':') >= 0 &&  # triage before more testing for source route
       $addr =~ m{^ (       [ \t]* \@ (?: [0-9A-Za-z.!#\$%&*/^{}=_+-]* |
-                                         \[ (?: \\. | [^\]\\] )* \] ) [ \t]*
+                                   \[ (?: \\. | [^\]\\] ){0,999} \] ) [ \t]*
                      (?: , [ \t]* \@ (?: [0-9A-Za-z.!#\$%&*/^{}=_+-]* |
-                                         \[ (?: \\. | [^\]\\] )* \] ) [ \t]* )*
+                                   \[ (?: \\. | [^\]\\] ){0,999} \] ) [ \t]* )*
                      : [ \t]* ) (.*) \z }xs)
   { # NOTE: we are quite liberal on allowing whitespace around , and : here,
@@ -3371,7 +3370,8 @@
     $source_route = $1; $addr = $2;
   }
-  if ($addr =~ m{^ (    (?: [^"@]+ | " (?: \\. | [^"\\] )* " | . )*? )
-                   ( \@ (?: [^"@\[\]\\ \t]+ | \[ (?: \\. | [^\]\\] )* \]
-                          | [EMAIL PROTECTED] )* )? \z}xs) {
+  if ($addr =~ m{^ ( .*? )
+                 ( \@ (?: [EMAIL PROTECTED] | \[ (?: \\. | [^\]\\] ){0,999} \]
+                          | [EMAIL PROTECTED] )* )
+                 \z}xs) {
     ($localpart,$domain) = ($1,$2);
   } else {
@@ -3425,19 +3425,26 @@
     if ($comm_lvl > 0 && /\G( \) )/gcsx) { $comm_lvl--; next }
     if (!$in_qcontent && !$in_literal && /\G( \( )/gcsx) { $comm_lvl++; next }
-    if ($comm_lvl > 0 && /\G( (?: \\. | [^()\\] )+ )/gcsx) { next }
+    if ($comm_lvl > 0 && /\G( \\.      )/gcsx) { next }
+    if ($comm_lvl > 0 && /\G( [^()\\]+ )/gcsx) { next }
     # quoted content
-    if ($in_qcontent && /\G( " )/gcsx)
+    if ($in_qcontent && /\G( " )/gcsx)  # normal exit from qcontent
       { $in_qcontent = 0; ($in_angle?$p:$s) .= $1; next }
+    if ($in_qcontent && /\G( > )/gcsx)  # bail out of qcontent
+      { $in_qcontent = 0; $in_angle = 0; $after_at = 0;
+        ($in_angle?$p:$s) .= $1; next }
     if (!$comm_lvl && !$in_qcontent && !$in_literal && /\G( " )/gcsx)
       { $in_qcontent = 1; ($in_angle?$p:$s) .= $1; next }
-    if ($in_qcontent && /\G( (?: \\. | [^"\\] )+ )/gcsx)
-      { ($in_angle?$p:$s) .= $1; next }
+    if ($in_qcontent && /\G( \\.      )/gcsx) { ($in_angle?$p:$s) .= $1; next }
+    if ($in_qcontent && /\G( [^"\\>]+ )/gcsx) { ($in_angle?$p:$s) .= $1; next }
     # address literal
     if ($in_literal && /\G( \] )/gcsx)
       { $in_literal = 0; ($in_angle?$p:$s) .= $1; next }
+    if ($in_literal && /\G( > )/gcsx)  # bail out of address literal
+      { $in_literal = 0; $in_angle = 0; $after_at = 0;
+        ($in_angle?$p:$s) .= $1; next }
     if (!$comm_lvl && !$in_qcontent && /\G( \[ )/gcsx)
       { $in_literal = 1 if $after_at; ($in_angle?$p:$s) .= $1; next }
-    if ($in_literal && /\G( (?: \\. | [^\]\\] )+ )/gcsx)
-      { ($in_angle?$p:$s) .= $1; next }
+    if ($in_literal && /\G( \\.       )/gcsx) { ($in_angle?$p:$s) .= $1; next }
+    if ($in_literal && /\G( [^\]\\>]+ )/gcsx) { ($in_angle?$p:$s) .= $1; next }
     # normal content
     if (!$comm_lvl && !$in_qcontent && !$in_literal) {
@@ -3456,7 +3463,7 @@
       if (!$in_group && /\G( ; )/gcsx)                # out of place special
         { ($in_angle?$p:$s) .= $1; $after_at = 0; next }
-      if (/\G( \@ )/gcsx)   { $after_at = 1; ($in_angle?$p:$s) .= $1; next }
-      if (/\G( [ \t]+ )/gcsx)              { ($in_angle?$p:$s) .= $1; next }
-      if (/\G( [^,:;@<>()"\[\]\\]+ )/gcsx) { ($in_angle?$p:$s) .= $1; next }
+      if (/\G( \@ )/gcsx)    { $after_at = 1; ($in_angle?$p:$s) .= $1; next }
+      if (/\G( [ \t]+ )/gcsx)               { ($in_angle?$p:$s) .= $1; next }
+      if (/\G( [^,:;\@<>()"\[\]\\]+ )/gcsx) { ($in_angle?$p:$s) .= $1; next }
     }
     if (/\G( . )/gcsx) { ($in_angle?$p:$s) .= $1; next }  # other junk
@@ -13765,6 +13772,6 @@
         local($1,$2);
         if ($args !~ /^FROM: [ \t]*
-                      ( < (?: " (?: \\. | [^\\"] )* " | [^"@ \t] )*
-                          (?: @ (?: \[ (?: \\. | [^\]\\] )* \] |
+                      ( < (?: " (?: \\. | [^\\"] ){0,999} " | [^"@ \t] )*
+                          (?: @ (?: \[ (?: \\. | [^\]\\] ){0,999} \] |
                                     [^\[\]\\> \t] )* )? > )
                       (?: [ \t]+ (.+) )? \z/isx ) {
@@ -13859,6 +13866,6 @@
         local($1,$2);
         if ($args !~ /^TO: [ \t]*
-                      ( < (?: " (?: \\. | [^\\"] )* " | [^"@ \t] )*
-                          (?: @ (?: \[ (?: \\. | [^\]\\] )* \] |
+                      ( < (?: " (?: \\. | [^\\"] ){0,999} " | [^"@ \t] )*
+                          (?: @ (?: \[ (?: \\. | [^\]\\] ){0,999} \] |
                                     [^\[\]\\> \t] )* )? > )
                       (?: [ \t]+ (.+) )? \z/isx ) {




Mark

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
AMaViS-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/amavis-user
AMaViS-FAQ:http://www.amavis.org/amavis-faq.php3
AMaViS-HowTos:http://www.amavis.org/howto/

Reply via email to