用 mail 命令可以查看你有多少邮件未读
mail
删除邮件
cat /dev/null > /var/spool/mail/root
方法一:禁止系统检查邮件
echo "unset MAILCHECK" >> /etc/profile
方法二:用logWatch转发邮件
vim /usr/share/logwatch/default.conf/logwatch.conf
修改为:
...
MailTo = yourmail@xx.com
...
mail
cat /dev/null > /var/spool/mail/root
echo "unset MAILCHECK" >> /etc/profile
vim /usr/share/logwatch/default.conf/logwatch.conf
修改为:
...
MailTo = yourmail@xx.com
...