分类: BSD
2009-01-04 02:53:30
完全关闭sendmail不仅需要将/etc/rc.conf中的sendmail_flags=”xxxx”改为sendmail_falgs=NO
由于系统定时任务还会启动它,所以还需作如下修改
修改/etc/daily
找到下面代码
sh /etc/security 2>&1 > $OUT
if [ -s $OUT ]; then
mail -s “$host daily insecurity output” root < $OUT
fi
修改如下
sh /etc/security 2>&1 > $OUT.TMP
if [ -s $OUT.TMP ]; then
echo “$host daily insecurity output” > $OUT
cat $OUT.TMP >> $OUT
rm $OUT.TMP
/usr/libexec/mail.local root > $OUT
fi
修改crontab
#crontab -u root -e
30 1 * * * /bin/sh /etc/daily 2>&1 | tee /var/log/daily.out | mail - s “`/bin/hostname` daily output” root
30 3 * * 6 /bin/sh /etc/weekly 2>&1 | tee /var/log/weekly.out | mail -s “`/bin/hostname` weekly output” root
30 5 1 * * /bin/sh /etc/monthly 2>&1 | tee /var/log/monthly.out | mail -s “`/bin/hostname` monthly output” root
修改为
30 1 * * * /bin/sh /etc/daily 2>&1 | tee /var/log/daily.out | /usr/libexec/mail.local root
30 3 * * 6 /bin/sh /etc/weekly 2>&1 | tee /var/log/weekly.out | /usr/libexec/mail.local root
30 5 1 * * /bin/sh /etc/monthly 2>&1 | tee /var/log/monthly.out | /usr/libexec/mail.local root
并注释掉启动Sendmail行
#*/30 * * * * /usr/sbin/sendmail -L sm-msp-queue -Ac -q