Spamassassin "matches null string many times ..." errors
Forrest Aldrich
forrie at forrie.com
Tue Jan 30 21:56:02 UTC 2007
I believe this issue has been addressed before. However, with the
latest port version of SpamAssassin, I continue to see these errors in
the logs:
Jan 30 08:00:41 mail spamd[1038]: (?:(?<=[\s,]))* matches null string
many times in rege
x; marked by <-- HERE in m/\G(?:(?<=[\s,]))* <-- HERE \Z/ at
/usr/local/lib/perl5/site_p
erl/5.8.8/Text/Wrap.pm line 46.
It appears to have been addressed at:
http://issues.apache.org/SpamAssassin/attachment.cgi?id=3751&action=view
There is a patch, which is small enough to post here. I wonder if this
can be included in the distribution/port -- but I wonder why the problem
hasn't been patched in the code itself...
Index: lib/Mail/SpamAssassin/Util.pm
===================================================================
--- lib/Mail/SpamAssassin/Util.pm (revision 473986)
+++ lib/Mail/SpamAssassin/Util.pm (revision 473988)
@@ -535,7 +535,16 @@
# There's a die() in there which "shouldn't happen", but better be
# paranoid. We'll return the unwrapped string if anything went wrong.
my $text = $_[0] || "";
+
+ # Text::Wrap produces spurious warnings:
+ # [23409] warn: (?:(?<=[\s,]))* matches null string many times in regex; marked by <-- HERE in m/\G(?:(?<=[\s,]))* <-- HERE \Z/ at /usr/local/perl594/lib/5.9.4/Text/Wrap.pm line 46.
+ # trap and ignore them. Why do so many of the core modules do this
+ # kind of crap? :( use a $SIG{__WARN__} to trap it.
+
eval {
+ local $SIG{__WARN__} = sub {
+ ($_[0] =~ /matches null string many times/) or CORE::warn(@_);
+ };
$text = Text::Wrap::wrap($_[2] || "", $_[1] || "", $text);
};
return $text;
More information about the freebsd-perl
mailing list