nhmj 发表于 2014-5-26 15:42:26

msmtp+mutt运行时报child exited 127 (Exec error.)错误的解决方法

在运行mutt命令时报下列错误
# echo "www.clvn.com.cn" | mutt -s "My Web" zabbix2018@sohu.com
Error sending message, child exited 127 (Exec error.).
Could not send the message.
解决方法:
先使用msmtp进行发送测试
# /usr/local/msmtp/bin/msmtp -S
SMTP server at smtp.sohu.com (), port 25:
    zw_71_37 ESMTP ready
Capabilities:
    STARTTLS:
      Support for TLS encryption via the STARTTLS command
    AUTH:
      Supported authentication methods:
      PLAIN LOGIN
This server might advertise more or other capabilities when TLS is active.
发现没有什么问题。

再利用msmtp查看当前文件路径
# /usr/local/msmtp/bin/msmtp -P
loaded system configuration file /usr/local/msmtp/etc/msmtprc
ignoring user configuration file /root/.msmtprc: No such file or directory
falling back to default account
using account default from /usr/local/msmtp/etc/msmtprc
host                  = smtp.sohu.com
port                  = 25
timeout               = off
protocol            = smtp
domain                = localhost
auth                  = LOGIN
user                  = zabbix2018
password            = *
passwordeval          = (not set)
ntlmdomain            = (not set)
tls                   = off
tls_starttls          = on
tls_trust_file      = (not set)
tls_crl_file          = (not set)
tls_fingerprint       = (not set)
tls_key_file          = (not set)
tls_cert_file         = (not set)
tls_certcheck         = on
tls_force_sslv3       = off
tls_min_dh_prime_bits = (not set)
tls_priorities      = (not set)
auto_from             = off
maildomain            = (not set)
from                  = zabbix2018@sohu.com
dsn_notify            = (not set)
dsn_return            = (not set)
keepbcc               = off
logfile               = /var/log/zabbix/msmtp.log
syslog                = (not set)
aliases               = (not set)
reading recipients from the command line
从上面显示配置文件也没有什么问题,但是查看Muttrc.loca时
# cat /etc/Muttrc.local
# Local configuration for Mutt.
set sendmail='/usr/local/msmtp/bin/msmtp"
set use_from=yes
set realname="zabbix2018@sohu.com"
set editor="vim"
可以看到双引号写成单引号了,更改此配置文件
# vim /etc/Muttrc.local
# Local configuration for Mutt.
set sendmail="/usr/local/msmtp/bin/msmtp"
set use_from=yes
set realname="zabbix2018@sohu.com"
set editor="vim"
再次进行发送测试
# echo "test" | mutt -s "test" clvn2008@qq.com
登录邮箱进行查看,可以看到收到邮件


页: [1]
查看完整版本: msmtp+mutt运行时报child exited 127 (Exec error.)错误的解决方法