Cron amavis - Logger中的宽字符

时间:2017-07-16 04:35:55

标签: ubuntu cron

Amavis经常把这封电子邮件发送到root:

主题:Cron <amavis@servername> test -e /usr/sbin/amavisd-new-cronjob && /usr/sbin/amavisd-new-cronjob sa-sync

身体:Wide character in print at /usr/share/perl5/Razor2/Logger.pm line 107.

如何修复它?感谢。

1 个答案:

答案 0 :(得分:0)

请试试这个。 代码就在这里......

sudo vi /usr/share/perl5/Razor2/Logger.pm

00008:   use POSIX qw(strftime);
00009:   use IO::File;
00010:   # 2003/09/10 Anne Bennett: syslog of our choice (uses socket,
00011:   # does not assume network listener).
00012:   use Sys::Syslog;
00013: + use Encode;
00014:   
00015:   # designed to be inherited module
00016:   # but can stand alone.

00106:         my $fd = $self->{fd};
00107: -       print $fd "$now_string$logstr";
00107: +       print $fd encode('utf-8', "$now_string$logstr");
00108:     }