最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
ubuntu下发送带有附件的邮件的例子
时间:2022-06-30 19:15:50 编辑:袖梨 来源:一聚教程网
一台服务器检查程序需要将检查结果自动发送给指定邮箱,想当然的使用mail命令,结果在测试时发现有错误:
mail: cannot send message: process exited with a non-zero status
其没有提到明确的问题,但从其中提出的log查看,倒是发现了线索。
有两个log都记录了对应的信息,即syslog和mail.err。mail.err中的信息更明确:
postfix/sendmail[27115]: fatal: open /etc/postfix/main.cf: No such file or directory
然后意识到这台服务器安装完成后并没有配置postfix服务,于是重新配置:
sudo dpkg-reconfigure postfix
然后再使用mail命令发送邮件就正常了:
echo "FTP2 dataset file has been changed. Please use the attachment to find the differences." | mail -s "FTP2 dataset file change" -A Diff.html [email protected]
相关文章
- 梦幻西游109花果山平民如何选择装备 07-07
- danny0926/ppt-skills 第一次生成 HTML 演示先试什么:入口、小稿和预览信号(skill首测版) 07-07
- 记一次分布式事务数据不一致的排查之旅:从超时到索引:层层剥茧 07-07
- PostgreSQL 在 MyBatis 中执行正常 SQL 失效:一次 DELETE USING 踩坑记录 07-07
- MyBatis批量insert-select踩坑:useGeneratedKeys=true 可能引起PostgreSQL返回大量插入结果 07-07
- Vibe Coding 全栈实战:章鱼哥解题 03 - 从教材检索到 AI 回答生成 07-07