Michael,

> This in maillog:
>   451 4.5.0 Error in processing, id=40691-13,
>   check_init2 FAILED: parse_address_list PANIC1 53
>   at /usr/local/sbin/amavisd line 32
> Postcat shows this: (obviously some spammer with a 13 year old
> programming)

> Subject: Mail from kabukisprings.com
> From: [EMAIL PROTECTED] <[EMAIL PROTECTED],
>   "\
>
> "@86597-app1.jdvhospitality.com
> Content-Transfer-Encoding: 7bit

Thanks!
The following patch fixes parsing of such broken From header field:


--- amavisd~    Mon Apr 23 05:25:30 2007
+++ amavisd     Tue May 15 15:55:09 2007
@@ -3285,14 +3285,14 @@
 sub parse_address_list($) {
   local($_) = $_[0];
-  local($1); $p = ''; $s = ''; @addresses = ();
-  s/\n([ \t])/$1/gs; s/\n+\z//s;  # unfold, chomp
+  local($1); s/\n([ \t])/$1/gs; s/\n+\z//s;  # unfold, chomp
+  my($str_l) = length($_); $p = ''; $s = ''; @addresses = ();
   my($comm_lvl) = 0; my($in_qcontent) = 0; my($in_literal) = 0;
   my($in_group) = 0; my($in_angle) = 0; my($after_at) = 0; my($new_pos);
-  for (my $pos=-1;  $new_pos=pos($_), !/\G \z/gcsx;  $pos=$new_pos) {
+  for (my $pos=-1;  $new_pos=pos($_), $new_pos<$str_l;  $pos=$new_pos) {
     $new_pos > $pos or die "parse_address_list PANIC1 $new_pos"; # just in case
     # comment (may be nested: rfc2822 section 3.2.3)
     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 }
     # quoted content
     if ($in_qcontent && /\G( " )/gcsx)
@@ -3300,5 +3300,5 @@
     if (!$comm_lvl && !$in_qcontent && !$in_literal && /\G( " )/gcsx)
       { $in_qcontent = 1; ($in_angle?$p:$s) .= $1; next }
-    if ($in_qcontent && /\G( (?: \\. | [^"\\] )* )/gcsx)
+    if ($in_qcontent && /\G( (?: \\. | [^"\\] )+ )/gcsx)
       { ($in_angle?$p:$s) .= $1; next }
     # address literal
@@ -3307,5 +3307,5 @@
     if (!$comm_lvl && !$in_qcontent && /\G( \[ )/gcsx)
       { $in_literal = 1 if $after_at; ($in_angle?$p:$s) .= $1; next }
-    if ($in_literal && /\G( (?: \\. | [^\]\\] )* )/gcsx)
+    if ($in_literal && /\G( (?: \\. | [^\]\\] )+ )/gcsx)
       { ($in_angle?$p:$s) .= $1; next }
     # normal content



Mark

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
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