我在 Ubuntu 14.04.1 LTS 中运行的 Amavis 每天向我发送大约 4 封邮件,内容如下:
“pyzor: check failed: internal error, python traceback seen in response”
好吧,因为我没有看到任何回溯并且无法找到它,我用谷歌搜索...
第一个提示是“pyzor ping”。我以用户 amavis 的身份运行它,结果是“public.pyzor.org:24441 (200, 'OK')”
所以这似乎很好。它还活着。然后我测试了它是否“工作”。
Input:
spamassassin -D pyzor <1415394952.V54I4460799M230590.h2063374.stratoserver.net\:2\,Sa
Feedback:
Nov 25 08:48:16.182 [13757] dbg: pyzor: network tests on, attempting Pyzor
Nov 25 08:48:30.944 [13757] dbg: pyzor: pyzor is available: /usr/bin/pyzor
Nov 25 08:48:30.945 [13757] dbg: pyzor: opening pipe: /usr/bin/pyzor --homedir /etc/mail/spamassassin check < /tmp/.spamassassin13757wvlpQJtmp
Nov 25 08:48:30.992 [13757] dbg: pyzor: [13759] finished successfully
Nov 25 08:48:30.992 [13757] dbg: pyzor: got response: public.pyzor.org:24441 (200, 'OK') 1 0
在没有任何帮助结果的情况下在谷歌进一步搜索后,我认为“查看 /usr/sbin/amavisd-new-cronjob 的内容!”
#!/bin/bash
# amavisd-new cronjob helper
#
# Run it as the amavis user
#
# First parameter specifies which cronjob routine to run:
# sa-sync: spamassassin fast sync
# sa-clean: spamassassin cleanup
test -e /usr/bin/sa-learn || exit 0
test -e /usr/sbin/amavisd-new || exit 0
if [ "$(id --name -u)" != "amavis" ]
then
echo "Please run this cronjob as user amavis"
exit 1
fi
set -e
umask 022
if ! perl -MMail::SpamAssassin -e "my \$spamtest = Mail::SpamAssassin->new();
\$spamtest->compile_now (); \$spamtest->{conf}->{use_bayes} ? exit 0 : exit 1"
then
#bayes is disabled - just exit
exit
fi
case $1 in
sa-sync)
/usr/bin/sa-learn --sync 2>&1 >/dev/null
;;
sa-clean)
/usr/bin/sa-learn --sync --force-expire 2>&1 >/dev/null
;;
*)
echo "$0: unknown cron routine $1" >&2
exit 1
;;
esac
exit 0
我能够以用户 Amavis 的身份成功执行“sa-sync”和“sa-clean”,因此错误必须在更远的地方。
我评论了以下几行,突然能够以用户 amavis 身份执行 amavisd-new-cronjob 而没有任何错误......
#if ! perl -MMail::SpamAssassin -e "my \$spamtest = Mail::SpamAssassin->new();
#\$spamtest->compile_now (); \$spamtest->{conf}->{use_bayes} ? exit 0 : exit 1"
#then
# #bayes is disabled - just exit
# exit
#fi
我不喜欢让它保持原样,因为我不确定这些行是做什么的,或者用户 amavis 需要哪些权限才能成功运行它们。
有没有人提示我如何解决这个问题?