我使用过mail
,它的退出状态为零,但收件人没有收到任何邮件。可能是什么问题呢?
我使用了这段代码:
mylinsystem:/etc/mail # mail -v -s "test" test_user@receipient_domain.com </tmp/txt
test_user@receipient_domain.com... Connecting to [127.0.0.1] via relay...
220 mylinsystem.receipient_domain.com ESMTP Sendmail 8.13.6/8.13.6/SuSE Linux 0.8; Thu, 27 Nov 2014 00:25:47 +0530
>>> EHLO mylinsystem.receipient_domain.com
250-mylinsystem.receipient_domain.com Hello localhost [127.0.0.1], pleased to meet you
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-8BITMIME
250-SIZE
250-DSN
250-ETRN
250-DELIVERBY
250 HELP
>>> MAIL From:<[email protected]_domain.com> SIZE=228
250 2.1.0 <[email protected]_domain.com>... Sender ok
>>> RCPT To:<test_user@receipient_domain.com>
>>> DATA
250 2.1.5 <test_user@receipient_domain.com>... Recipient ok
354 Enter mail, end with "." on a line by itself
>>> .
250 2.0.0 sAQItljm015768 Message accepted for delivery
test_user@receipient_domain.com... Sent (sAQItljm015768 Message accepted for delivery)
Closing connection to [127.0.0.1]
>>> QUIT
221 2.0.0 mylinsystem.receipient_domain.com closing connection
mylinsystem
如果运行mailq
,我会看到以下消息:
sAPLEEcO028725 14849 Wed Nov 26 02:44 <[email protected]>
(Deferred: Connection timed out with [163.181.51.401])
<test_user@receipient_domain.com>
答案1
mail
的退出状态仅指本地处理。它的意思是:“该邮件已被当地 MTA 接受。”它不能说明邮件是否成功投递,因为目前还没有尝试过。