linux下mail使用故障mail: command not found
来源:互联网 发布:车辆mod修改软件 编辑:程序博客网 时间:2024/05/29 07:06
因为监控的需求,所以写了个简单的脚本将服务器上的信息发送到我的邮箱,脚本编写完后运行,首先出现:
-bash: mail: command not found
后来想起系统当初是最小化安装的,很多工具包都没有安装,接着发现sendmail也没有安装,于是就一并yum安装完事:
yum -y install mailx sendmail
等待安装完后,再次运行脚本,没有报错,但是邮件确没有发送出去,查看服务器mail日志发现:
cat /var/log/maillog
Dec 17 11:42:29 localhost sendmail[30528]: qBH3gT5P030528: to=test@163.com, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30138, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
出现这个错误的原因是/var/spool/mail这个目录的权限不够,需要设置成777
chmod -R 777 /var/spool/mail
然后重启sendmail服务
service sendmail restart
再次调用脚本,一起正常。
阅读全文
0 0
- linux下mail使用故障mail: command not found
- mail command not found
- bash: mail: command not found的解决方法
- Linux下mail使用技巧
- linux下使用shutdown命令关机,提示: command not found
- Linux下mail命令使用总结
- Linux系统下mail命令使用
- Linux系统下mail命令使用
- Linux下使用mail、mutt发送邮件
- Linux下使用mail命令发送邮件
- Linux下使用mail命令发送邮件
- linux下使用uuencode+mail发送附件
- Linux下使用mail命令发送邮件
- Linux下使用mail命令发送邮件
- linux下简单的mail使用
- Linux mail命令使用
- Linux mail使用
- linux mail 命令使用
- 与非 乱搞233
- mysql数据库锁定机制
- mysql 4种插入语句的区别。
- 类型重定义、基类未定义
- There was an error when generating this application with JHipster解决
- linux下mail使用故障mail: command not found
- RocketMQ存储篇——Consumequeue
- Redis教程之一Linux安装Redis
- 组合式控件(购物车数量的加减)
- 用于准确测量运行时间
- JSON对象转换成字符串 相互转换 的几种方式
- 利用机器学习方法确定各个特征的权重
- visjs使用小记-3.简单网络拓扑图的折叠与展开
- centos设置自动开关机