![mutt 发送邮件失败,错误信息为“sendmail: 无法打开邮件:25](https://linux22.com/image/677282/mutt%20%E5%8F%91%E9%80%81%E9%82%AE%E4%BB%B6%E5%A4%B1%E8%B4%A5%EF%BC%8C%E9%94%99%E8%AF%AF%E4%BF%A1%E6%81%AF%E4%B8%BA%E2%80%9Csendmail%3A%20%E6%97%A0%E6%B3%95%E6%89%93%E5%BC%80%E9%82%AE%E4%BB%B6%3A25.png)
你好,我正在尝试使用下面的 mutt 命令发送邮件,
mutt -s "test" [email protected] </dev/null
失败并出现以下错误,
sendmail: Cannot open mail:25
Error sending message, child exited 1 ().
Could not send the message.
此问题发生在 Fedora 22 和 Fedora 23 机器上。我曾经在 Fedora 12 上运行过同样的程序,运行正常
尝试修改文件“/etc/ssmtp/ssmtp.conf”中的以下值
mailhub=mail
到
mailhub=fqdn_of_my_machine
我仍然收到如下类似错误,
sendmail: Cannot open fqdn_of_my_machine:25
Error sending message, child exited 1 ().
Could not send the message.
即使 sendmail 我也收到与上述相同的错误,
sendmail [email protected] < /tmp/file1
sendmail: Cannot open fqdn_of_my_machine:25
答案1
正如 natxo 上面提到的,我们需要安装 smtp 包并对其进行配置。所以我尝试了以下命令,它成功了,
# smtp --> it will ask that package not install [Yes]
dnf install sendmail # (install few other dep)
dnf install sendmail-cf # (its used to configure automatically)