retitle 496254 perl: Syslog.pm adds newline and later EOL whitespace to spamassassin /var/log/syslog messages reassign 496254 perl 5.8.8-7etch3 tags 496254 + patch thanks
Hello This is also in lenny perl 5.10.0-19 A somewhat related bug about NULLs is #356700 I can not see that the call syslog($level, "%s", $msg); in /usr/share/perl5/Mail/SpamAssassin/Logger/Syslog.pm is the problem here. This also messes up logcheck for spamassassin that will not match correctly with added EOL whitespace in syslog. This is the second mail, the first have not yet been processed but it was received yesterday by the Debian server. I'l retry from a different server. 2009-03-21 23:44:25 1Ll9vV-0006KY-2x <= j...@home.se H=(tpjohthe.localnet) [10.1.4.16] P=esmtpsa X=TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32 DN="" A=plain_server:johan S=2124 id=200903212344.27368....@home.se T="perl: Syslog.pm adds newline and later EOL whitespace to spamassassin /var/log/syslog messages" 2009-03-21 23:44:28 1Ll9vV-0006KY-2x => 496...@bugs.debian.org R=dnslookup T=remote_smtp H=rietz.debian.org [140.211.166.43] 2009-03-21 23:44:28 1Ll9vV-0006KY-2x -> cont...@bugs.debian.org R=dnslookup T=remote_smtp H=rietz.debian.org [140.211.166.43] 2009-03-21 23:44:28 1Ll9vV-0006KY-2x Completed This make the local /var/log/syslog work as expected by commenting out the command that add the newline in the sprintf mask, later converted to space after the message. It will still add another newline when sending to a remote host. I will try to find that one also. Another way to fix this would be to filter the EOL whitespace at some later stage. Could also be a ksyslogd bug that it should strip EOL whitespace. But I think the system should not alter log messages too much if not really needed. --- /usr/lib/perl/5.10.0/Sys/Syslog.pm.org 2009-03-21 22:01:52.000000000 +0100 +++ /usr/lib/perl/5.10.0/Sys/Syslog.pm 2009-03-21 21:38:00.000000000 +0100 @@ -330,7 +330,7 @@ $mask =~ s/(?<!%)((?:%%)*)%m/$1$error/g; } - $mask .= "\n" unless $mask =~ /\n$/; +# $mask .= "\n" unless $mask =~ /\n$/; $message = @_ ? sprintf($mask, @_) : $mask; # See CPAN-RT#24431. Opened on Apple Radar as bug #4944407 on 2007.01.21 -- Johan Thelmén -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org