Message causes amavis to stop processing

Mark Martinec Mark.Martinec+amavis at ijs.si
Tue May 3 18:56:35 CEST 2011


Alex,

> Okay, I converted that to a real message, since it's the only instance
> of it that I have, by stripping the queue information and adding a
> dummy "From " at the top. It still gets stuck.
> 
> It also gets stuck with -L, just doing local tests. It seems to stop
> processing at no particular point:
> 
> Apr 27 15:49:57.231 [9943] dbg: rules: flush_evalstr
> (run_generic_tests) compiling 41329 chars of
> Mail::SpamAssassin::Plugin::Check::_rawbody_tests_0_1
> Apr 27 15:49:57.236 [9943] dbg: rules: run_generic_tests - compiling
> eval code: rawbody, priority 0
> Apr 27 15:49:57.236 [9943] dbg: rules: compiled rawbody tests
> 
> ..and that's it. I checked through the output for anything obvious,
> but didn't find anything that indicated some type of obvious failure.

For stubborn cases like this where some SA rule gets stuck in a loop, I usually add
a debug call to Mail::SpamAssassin::Plugin::Check::hash_line_for_rule,
which will output an:

  dbg: rules: will run ...

_before_ invoking any rule, so that you can see which rule is causing a
problem.

The patch for SpamAssassin 3.3.1 is below. Similar applies to SA trunk
(3.4.0), where the debug line is already provided, but commented out.


--- Mail/SpamAssassin/Plugin/Check.pm~	2010-03-16 15:49:21.000000000 +0100
+++ Mail/SpamAssassin/Plugin/Check.pm	2011-05-03 18:45:54.768147255 +0200
@@ -1298,7 +1298,9 @@
 sub hash_line_for_rule {
   my ($self, $pms, $rulename) = @_;
-  return sprintf("\n#line 1 \"%s, rule %s,\"",
-                 untaint_var($pms->{conf}->{source_file}->{$rulename}),
-                 $rulename);
+  # using tainted subr. argument may taint the whole expression, avoid
+  my $u = untaint_var($pms->{conf}->{source_file}->{$rulename});
+# return sprintf("\n#line 1 \"%s, rule %s,\"", $u, $rulename);
+  return sprintf("\n#line 1 \"%s, rule %s,\"", $u, $rulename) .
+         "\ndbg(\"rules: will run %s\", q(".$rulename."));\n";
 }
 


Mark


More information about the amavis-users mailing list