centos 5.3 64
用mutt 发送邮件。发不了。检查host文件,修改为如下:
[root@server217 ~]#cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
192.168.0.217 server217 server217.localdomain localhost
127.0.0.1 localhost
还是发不出去。重新启动sendmail服务。就可以发送。
#service sendmail restart
发送不成功的日志:
Feb 21 09:25:24 server217 sendmail[9284]: q1L1POSb009284: from=root, size=817, class=0, nrcpts=1, msgid=<>,
Feb 21 09:25:24 server217 sendmail[9284]: q1L1POSb009284:, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30817, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
发送成功的日志:
Feb 21 09:25:42 server217 sendmail[9304]: alias database /etc/aliases rebuilt by root
Feb 21 09:25:42 server217 sendmail[9304]: /etc/aliases: 76 aliases, longest 10 bytes, 765 bytes total
Feb 21 09:25:42 server217 sendmail[9309]: starting daemon (8.13.8):
Feb 21 09:25:43 server217 sm-msp-queue[9318]: starting daemon (8.13.8):
Feb 21 09:25:46 server217 sendmail[9332]: q1L1Pjx5009332: from=root, size=817, class=0, nrcpts=1, msgid=<>,
Feb 21 09:25:46 server217 sendmail[9333]: q1L1Pkvo009333: from=<>, size=969, class=0, nrcpts=1, msgid=<>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1] (may be forged)
Feb 21 09:25:46 server217 sendmail[9332]: q1L1Pjx5009332:, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30817, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q1L1Pkvo009333 Message accepted for delivery)
Feb 21 09:25:47 server217 sendmail[9335]: STARTTLS=client, relay=mail.gggggggggggg.cn., version=TLSv1/SSLv3, verify=FAIL, cipher=DHE-RSA-AES256-SHA, bits=256/256
Feb 21 09:25:47 server217 sendmail[9335]: q1L1Pkvo009333: to=<>, ctladdr=<> (0/0), delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=120969, relay=mail.gggggggggggg.cn. [219.232.241.42], dsn=2.0.0, stat=Sent (Ok: queued as 1610DDB9219)
[root@server217 cron.daily]# cat senddisk.sh
#!/bin/bash
export PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
df -h |mutt -s "`ifconfig |grep Bcast |head -1| cut -c 10-35`"
更多参考: