歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> linux mail發送郵件stat=sent卻沒有收到郵件解決

linux mail發送郵件stat=sent卻沒有收到郵件解決

日期:2017/3/1 16:21:54   编辑:關於Linux
linux mail發送郵件stat=sent卻沒有收到郵件解決 今天嘗試著想要在linux終端上直接用mail命令(e.g: mail -s "hello" [email protected])給我163.com的郵箱發郵件時,163.com郵箱根本收不到,但是總是可以在/var/mail/root下面找到我剛才發的郵件,其實這是因為發送失敗了,從而被sendmail回退了郵件回來。 要想看失敗原因, check /var/log/maillog: Aug 1 18:41:40 localhost sendmail[5279]: o71Afeih005279: from=root, size=220, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost Aug 1 18:41:42 localhost sendmail[5281]: o71Afekr005281: from=<[email protected]>, size=480, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1] Aug 1 18:41:42 localhost sendmail[5279]: o71Afeih005279: [email protected], ctladdr=root (0/0), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=30220, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o71Afekr005281 Message accepted for delivery) Aug 1 18:41:44 localhost sendmail[5283]: o71Afekr005281: to=<[email protected]>, ctladdr=<[email protected]> (0/0), delay=00:00:03, xdelay=00:00:02, mailer=esmtp, pri=120480, relay=mx.139.com. [221.176.6.96], dsn=5.0.0, stat=Service unavailable Aug 1 18:41:44 localhost sendmail[5283]: o71Afekr005281: o71Afikr005283: DSN: Service unavailable Aug 1 18:41:44 localhost sendmail[5283]: o71Afikr005283: to=<[email protected]>, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31717, dsn=2.0.0, stat=Sent 後來在google上找了很多,最後終於找到原因了: I fixed the problem by changing the hostname of my server. Apparently "localhost.localdomain" will get rejected automatically by a lot of mail servers. As soon as I changed my hostname to "extra.idahostatesman.com" (a domain that is hosted on the server), everything just worked and I had no more problems sending e-mail. 可以用hostanme 命令臨時修改主機名,hostname aa.com; 還是失敗了 Aug 1 19:11:33 localhost sendmail[5579]: o71BBVB9005579: from=root, size=221, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost Aug 1 19:11:35 localhost sendmail[5580]: o71BBX3b005580: from=<[email protected]>, size=436, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1] Aug 1 19:11:35 localhost sendmail[5579]: o71BBVB9005579: [email protected], ctladdr=root (0/0), delay=00:00:04, xdelay=00:00:02, mailer=relay, pri=30221, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (o71BBX3b005580 Message accepted for delivery) Aug 1 19:11:39 localhost sendmail[5582]: o71BBX3b005580: to=<[email protected]>, delay=00:00:04, xdelay=00:00:04, mailer=esmtp, pri=120436, relay=mx.139.com. [221.176.6.96], dsn=4.0.0, stat=Deferred: 450 Requested action not taken:cmmx01, AS0QrJA75wiRVlVMWIvlAA--.3152S2, dynamic, reputation, zen.spamhaus.org, please try again 切記:修改完hostname以後需要重啟sendmail 服務,重啟服務後,一切ok.
Copyright © Linux教程網 All Rights Reserved