我已经将 SMART_HOST 定义为特定服务器,我们将其称为 foo.bar.com。但是,当我使用“sendmail -t”发送测试邮件时,sendmail 会尝试使用 mx.bar.com,随后会拒绝我的邮件。我已验证 foo.bar.com 可以工作,而 mx.bar.com 不工作(耶,telnet)。我已重新编译 sendmail.mc vi make、make -C 和 m4。我已验证 sendmail.cf 中的 DS 条目。我已正确重新启动 sendmail。我不确定此时该如何继续。有什么想法吗?
这是我的 SMART_HOST 行:
定义(SMART_HOST',
foo.bar.com')dnl
...这是测试邮件的结果。它从未尝试使用 foo.bar.com,而是使用 mx.bar.com。
$ echo subject: test; echo | sendmail -Am -v -flocaluser -- [email protected] subject: test
[email protected]... Connecting to mx.bar.com via relay...
220 mx.bar.com ESMTP
>>> EHLO myhost.bar.com
250-mx.bar.com
250-8BITMIME
250 SIZE 52428800
>>> MAIL From:<[email protected]> SIZE=1
250 sender <[email protected]> ok
>>> RCPT To:<[email protected]>
550 #5.1.0 Address rejected.
>>> RSET
250 reset
localuser... Connecting to local...
localuser... Sent
Closing connection to mx.bar.com.
>>> QUIT
221 mx.bar.com
最后,这是使用 foo.bar.com 发送的测试邮件:
$ hostname
myhost.bar.com
$ telnet foo.bar.com 25
Trying ***.***.***.***...
Connected to foo.bar.com (***.***.***.***).
Escape character is '^]'.
220 foo.bar.com ESMTP Sendmail 8.14.1/8.14.1/ITS-7.0/ldap2-1+tls; Tue, 21 Dec 2010 13:27:44 -0700 (MST)
helo foo
250 foo.bar.com Hello myhost.bar.com [***.***.***.***], pleased to meet you
mail from: [email protected]
250 2.1.0 [email protected]... Sender ok
rcpt to: [email protected]
250 2.1.5 [email protected]... Recipient ok
data
354 Enter mail, end with "." on a line by itself
testing
.
250 2.0.0 oBLKRikZ003758 Message accepted for delivery
quit
221 2.0.0 foo.bar.com closing connection
Connection closed by foreign host.
有任何想法吗?
谢谢
答案1
Sendmail 可能正在对域执行 MX 查找,这不一定是您想要的。将主机名括在方括号中可防止这种情况发生。
define(`SMART_HOST',`[foo.bar.com]')dnl