现象一:发送邮件执行时报错
root@/usr/bin# echo "hello this echo print"|mutt -s"linkmail"coobutter@live.com
Error sending message, child exited 127 (Exec error.).
Could not send the message.
先单独使用msmtp发送测试:msmtp -S 发现是配置文件没找到
msmtp: account default not found: no configuration file available
查看当前的配置文件路径:msmtp -P
ignoring system configuration file/work/target/etc/msmtprc: No such file or directory
ignoring user configuration file /root/.msmtprc: No such file ordirectory
falling back to default account
msmtp: account default not found: no configuration file available
故将/usr/local/etc/Muttrc 复制为/root/.muttrc
将/usr/local/etc/msmtprc 复制为/root/.msmtprc
即可。
现象二:发送邮件服务器退回邮件(邮件服务器认为发送的是垃圾邮件)
msmtp: the server did not accept the mail
msmtp: server message: 543 reject byentas5-smtp(ID:1361427919.643)(time:Thu Feb 21 14:25:29 2013)
msmtp: could not send mail (account default from/usr/local/etc/msmtprc)
因为没有填写from和to段。
此外如果是通过smtp.163.com发送的话,也必须要填写from和to段,否则,163将认为其是垃圾文件,拒绝转发。
host smtp.163.com
port 25
from coobutter@163.com
auth login
tls off
user coobutter@163.com
password ***** #密码
logfile /var/log/msmtp.log
解决邮件发送错误及垃圾邮件退回问题
本文详细解析了邮件发送过程中遇到的错误及垃圾邮件退回问题,并提供了相应的解决方案。首先,通过复制配置文件解决了邮件发送失败的问题;其次,阐述了在使用特定邮件服务器时必须填写 from 和 to 段的重要性,避免被误判为垃圾邮件。
767

被折叠的 条评论
为什么被折叠?



