如何防止/var/log/mail.log膨胀?

如何防止/var/log/mail.log膨胀?

我正在使用 Ubuntu 11.10(oneiric)。

/var/log/mail我的服务器上不断膨胀:

Aug  5 10:48:25 domU-12-31-39-0B-C4-54 sm-msp-queue[13360]: q71He1xw027248: to=postmaster, delay=3+17:03:10, xdelay=00:00:00, mailer=relay, pri=23074446, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug  5 10:48:25 domU-12-31-39-0B-C4-54 sm-msp-queue[13308]: q717K1wk024979: to=postmaster, delay=4+03:23:18, xdelay=00:00:00, mailer=relay, pri=25779463, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Aug  5 10:48:25 domU-12-31-39-0B-C4-54 sm-msp-queue[13360]: q71He1xx027248: to=postmaster, delay=3+17:03:10, xdelay=00:00:00, mailer=relay, pri=23075343, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
...

我不直接使用 sendmail,并且更愿意禁用它。

sendmail 似乎无法启动:

$ sudo /etc/init.d/sendmail start 
* Starting Mail Transport Agent (MTA) sendmail
451 4.0.0 /etc/mail/sendmail.cf: line 100: fileclass: 
cannot open '/etc/mail/local-host-names': Group writable directory

我相信我拥有正确的权限:

$ ls -ld /etc/mail/local-host-names
-rw-r--r-- 1 root root 52 2011-12-04 06:58 /etc/mail/local-host-names

但是...父文件夹的权限是否正常?

g$ ls -ld / /etc /etc/mail
drwxr-xr-x 23 root  root  4096 2012-05-23 08:38 /
drwxrwxr-x 99 root  root  4096 2012-08-05 07:29 /etc
drwxr-sr-x  7 smmta smmsp 4096 2011-12-04 06:58 /etc/mail

我想修复 sendmail 或禁用它。我试过:

$ sudo update-rc.d sendmail disable
update-rc.d: warning: sendmail start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5)
update-rc.d: warning: sendmail stop runlevel arguments (none) do not match LSB Default-Stop values (1)
 Disabling system startup links for /etc/init.d/sendmail ...
 Removing any system startup links for /etc/init.d/sendmail ...
   /etc/rc0.d/K19sendmail
   /etc/rc1.d/K19sendmail
   /etc/rc2.d/K79sendmail
   /etc/rc3.d/K79sendmail
   /etc/rc4.d/K79sendmail
   /etc/rc5.d/K79sendmail
   /etc/rc6.d/K19sendmail
 Adding system startup for /etc/init.d/sendmail ...
   /etc/rc0.d/K19sendmail -> ../init.d/sendmail
   /etc/rc1.d/K19sendmail -> ../init.d/sendmail
   /etc/rc6.d/K19sendmail -> ../init.d/sendmail
   /etc/rc2.d/K79sendmail -> ../init.d/sendmail
   /etc/rc3.d/K79sendmail -> ../init.d/sendmail
   /etc/rc4.d/K79sendmail -> ../init.d/sendmail
   /etc/rc5.d/K79sendmail -> ../init.d/sendmail

但我的 mail.log 仍然出现相同的错误。

我查看的其他链接:

答案1

我相信您没有 /etc 的正确权限。它也不能是组可写的。尝试

sudo chmod g-w /etc

这有帮助吗?

相关内容