Email

未擷取的本地電子郵件在哪裡?

  • January 3, 2014

假設我跑 -

mail goldfish

系統上沒有這樣的帳戶,也沒有定義這樣的別名,郵件會去哪裡?

如何查看此類郵件的列表?

由於目標伺服器上的郵件守護程序缺少目標地址,該電子郵件將作為無法投遞的郵件返回給發件人。

沒有郵件伺服器執行

當我嘗試在我的 Fedora 19 系統上建構虛假電子郵件時,我在系統的/var/log/maillog.

$ mail blah@localhost
Subject: test
test
.
EOT

內容/var/log/maillog

$ more maillog
Jan  2 23:16:45 greeneggs sendmail[21847]: s034Gi1W021847: from=saml, size=209, class=0, nrcpts=1, msgid=<201401030416.s034Gi1W021847@gree
neggs.bubba.net>, relay=root@localhost
Jan  2 23:16:45 greeneggs sendmail[21847]: s034Gi1W021847: to=blah@localhost, ctladdr=saml (1000/1000), delay=00:00:01, xdelay=00:00:00, m
ailer=relay, pri=30209, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]

這對我來說意味著郵件伺服器從一開始就從未接受過電子郵件,因此它很可能被踢回發件人或一起被忽略,無處可去。

郵件伺服器執行

隨著 sendmail 的執行。

$ service sendmail start
Redirecting to /bin/systemctl start  sendmail.service

確認其開始:

$ ps -eaf | grep [s]endmail
root     22157     1  0 23:20 ?        00:00:00 sendmail: accepting connections
smmsp    22173     1  0 23:20 ?        00:00:00 sendmail: Queue runner@01:00:00 for /var/spool/clientmqueue

重複相同的測試:

$ mail blah@localhost
Subject: test2
test
.
EOT

我們現在從郵件伺服器收到地址不存在的退回收據。

...
The original message was received at Thu, 2 Jan 2014 23:28:37 -0500
from root@localhost

  ----- The following addresses had permanent fatal errors -----
blah@localhost
   (reason: 550 5.1.1 <blah@greeneggs.bubba.net>... User unknown)
   (expanded from: blah@localhost)

  ----- Transcript of session follows -----
... while talking to [127.0.0.1]:
>>> DATA
<<< 550 5.1.1 <blah@greeneggs.bubba.net>... User unknown
550 5.1.1 blah@localhost... User unknown
<<< 503 5.0.0 Need RCPT (recipient)
...

這齣現在我的使用者的電子郵件假離線這裡:/var/spool/mail/saml

引用自:https://unix.stackexchange.com/questions/107628