邮件服务器不在Web主机上时,sendmail和MX记录 [英] sendmail and MX records when mail server is not on web host

查看:152
本文介绍了邮件服务器不在Web主机上时,sendmail和MX记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个问题,我确定很容易解决,但是我整天一直在敲我的头。

This is a problem I'm sure is easy to fix, but I've been banging my head on it all day.

我正在开发一个新的客户端的网站。该网站驻留在(这是一个例子)website.com。我有一个PHP表单脚本将访问者的请求发送到requests@website.com。

I'm developing a new web site for a client. The web site resides at (this is an example) website.com. I have a PHP form script to email visitors' requests to requests@website.com.

当我在不同域上的登台服务器上编码时,都可以正常工作。当我移动到website.com时,邮件从不到达。网络服务器是在一个主要的ISP的虚拟主机上。

When I coded this on a staging server on a different domain, all worked fine. When I moved it to website.com, the mail messages never arrived. The web server is on a virtual host with a major ISP.

以下是我之前学到的内容:我的客户端的邮件服务器是一个盒子上的Microsoft Exchange办公室。邮件到达时,无论何时外界有人发邮件request@website.com。 但是,如果Web服务器发送到同一个电子邮件地址,则每次都会失败。这是一个PHP问题。我将shell安装到Web服务器上,并使用sendmail和UNIX邮件应用程序进行了测试。我也通过电子邮件从shell中的各种电子邮件帐户进行了测试。我可以发电子邮件给我自己,例如,只有没有人在website.com域名。

Here's what I've learned since then: My client's mail server is Microsoft Exchange on a box physically in their office. Whenever someone on the outside world emails requests@website.com, the mail arrives. But if the web server sends to the same email address, it fails every time. This is not a PHP problem. I secure shell in to the web server and have tested this both with sendmail and the UNIX mail application. I've also tested it by emailing various email accounts from the shell. I can email myself, for example, just nobody at the website.com domain.

简而言之,当我登录到website.com,邮件请求@ website.com,user@website.com,another_user@website.com都失败了。所有其他地址工作正常。我发现,那些丢弃的电子邮件被路由到网站服务器的收集帐户,他们坐在收件箱中。

In short, when I'm logged in to website.com, mail to requests@website.com, user@website.com, another_user@website.com all fail. All other addresses work fine. What I've discovered is those dropped emails are routed to the web server's "catchall" account where they sit in its inbox.

我在网站上完成了MX查找.COM。 MX记录指向mailsec.website.com。我可以telnet到mailsec.website.com端口25并查看SMTP服务器。

I've done an MX lookup on website.com. The MX record points to mailsec.website.com. I can telnet to mailsec.website.com port 25 and see the SMTP server.

在我看来,website.com在发送时没有进行MX查找邮件至requests@website.com。我的理论是,它将域识别为本地,看到没有请求用户帐户提供给它,并将邮件删除到全部帐户。我想要的是强制sendmail进行MX查找并将消息发送到Exchange服务器。我在这里结束了。我不知道如何做到这一点。

It appears to me that website.com isn't doing an MX lookup when it's sending mail to requests@website.com. My theory is that it recognizes the domain as local, sees that there's no "requests" user account to deliver it to, and drops the mail into the catchall account. What I want is to force sendmail to do the MX lookup and send the message on to the Exchange server. I'm at wit's end here. I can't figure out how to do this.

对于这个问题,我可能会在这里离开这里,并完全误解了这一点。互联网邮件和MX一直对我来说似乎是一个黑色的艺术,我的无知当然是在这个问题上显示出来。

For that matter, I may be way off base here and have misdiagnosed this entirely. Internet mail and MX has always seemed a black art to me, and my ignorance is certainly showing in this question.

推荐答案

问题是sendmail(您的进程)正在与本地sendmail守护进程通信。本地sendmail守护进程认为是因为它是website.com,它应该知道如何传递电子邮件。不幸的是,在to服务器字段中的实际地址不存在于Web服务器上,因此它将其转储到catchall邮箱中。您应该与您的ISP交谈,并让他们更新其sendmail配置,以便邮寄至... @ website.com的邮件转发到邮件交换器,而不是在本地处理。

I think the problem is that sendmail (your process) is talking to the local sendmail daemon. The local sendmail daemon thinks that because it is website.com, it should know how to deliver the email. Unfortunately, the actual address in the to field does not exist on the web server and thus it dumps it in the "catchall" mail box. You should talk to your ISP and have them update their sendmail configuration so that mail addressed to ...@website.com gets forward to the mail exchanger instead of being handled locally.

这篇关于邮件服务器不在Web主机上时,sendmail和MX记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆