我有问题,中继SMTP电子邮件到远程域在MailEnable,并需要一些帮助,以确定我到底是在服务器设置中遗漏了什么。
直到昨天我在服务器的DNS设置中添加了SPF记录之前,我的安装程序实际上一直工作正常。然后从昨晚开始(下一次系统试图发送自动电子邮件),发送到远程地址的电子邮件开始失败。据我所知,我正在SMTP调用的入站部分上进行身份验证,但是当它试图连接出站以将消息发送到另一台服务器时,它的行为就好像我还没有进行身份验证一样。
背景:这是我自己的服务器,从一家托管公司租来的。我可以访问IIS/Plesk/MailEnable中站点的所有设置。每当我的自定义VB.NET应用程序试图发送一封电子邮件到我自己域名上的另一个地址时,它就能正常工作。每当我的应用程序试图将相同的电子邮件发送到远程域上的地址时,我都会收到一封来自POSTMASTER@mydomain.com的电子邮件,内容如下:
MailEnable: Message could not be delivered to some recipients.
The following recipient(s) could not be reached:
Recipient: [SMTP:user@otherdomain.com]
Reason: 551 This mail server requires authentication before sending mail from a locally hosted domain. Please reconfigure your mail client to authenticate before sending mail.我编写了一个简单的VB.NET测试程序来尝试调试:
Dim replyTo As New System.Net.Mail.MailAddress("no-reply@mydomain.com", "MyUser")
Dim subject As String = "Test subject"
Dim SendTo As String = "user@otherdomain.com"
Dim body As String = "This is the email."
Dim message As New System.Net.Mail.MailMessage
message.From = New System.Net.Mail.MailAddress("no-reply@mydomain.com", "MyUser")
message.ReplyToList.Add(replyTo)
message.BodyEncoding = System.Text.Encoding.ASCII
message.IsBodyHtml = True
message.Subject = subject
message.Bcc.Add("mydomainBCC@mydomain.com")
message.Body = body
Dim smtp As New System.Net.Mail.SmtpClient("mydomain.com")
Dim smtpCredential As System.Net.NetworkCredential = New System.Net.NetworkCredential("no-reply@mydomain.com", "password")
smtp.UseDefaultCredentials = False
smtp.Credentials = smtpCredential
smtp.Port = 587
smtp.Send(message)在MailEnable中,我有:
为了完整起见,以下是昨天在DNS中设置的SPF记录:
v=spf1 a mx ipv4:75.XX.XX.XX include:_spf.google.com -allMailEnable还在服务器的根驱动器上创建了一个名为SMTP- in -TOP.TXT的文件,该文件记录了传入的身份验证的最高计数,我在该文件中看到了所有尝试计数的内容:
Recent Top Users Authentications During Previous Hour
no-reply@mydomain.com 4最后,下面是来自MailEnable的活动和调试日志,显示了一次事务尝试:
活动:
09/01/13 15:07:26 SMTP-IN 5300BA9154CC413AAD202DE4FBA6CB71.MAI 596 75.XX.XX.XX 220 mydomain.com ESMTP MailEnable Service, Version: 7.0-- ready at 09/01/13 15:07:26 0 0
09/01/13 15:07:26 SMTP-IN 5300BA9154CC413AAD202DE4FBA6CB71.MAI 596 75.XX.XX.XX EHLO EHLO mydomain-web-01 250-mydomain.com [75.XX.XX.XX], this server offers 4 extensions 127 21
09/01/13 15:07:26 SMTP-IN 5300BA9154CC413AAD202DE4FBA6CB71.MAI 596 75.XX.XX.XX AUTH {blank} 334 UGFzc3dvcmQ6 18 41 no-reply@mydomain.com
09/01/13 15:07:26 SMTP-IN 5300BA9154CC413AAD202DE4FBA6CB71.MAI 596 75.XX.XX.XX AUTH d29iVFY= 235 Authenticated 19 10 no-reply@mydomain.com
09/01/13 15:07:26 SMTP-IN 5300BA9154CC413AAD202DE4FBA6CB71.MAI 596 75.XX.XX.XX MAIL MAIL FROM:<no-reply@mydomain.com> 250 Requested mail action okay, completed 43 34 no-reply@mydomain.com
09/01/13 15:07:26 SMTP-IN 5300BA9154CC413AAD202DE4FBA6CB71.MAI 596 75.XX.XX.XX RCPT RCPT TO:<adam.taylor@otherdomain.com> 250 Requested mail action okay, completed 43 36 no-reply@mydomain.com
09/01/13 15:07:26 SMTP-IN 5300BA9154CC413AAD202DE4FBA6CB71.MAI 596 75.XX.XX.XX RCPT RCPT TO:<mydomainBCC@mydomain.com> 250 Requested mail action okay, completed 43 34 no-reply@mydomain.com
09/01/13 15:07:26 SMTP-IN 5300BA9154CC413AAD202DE4FBA6CB71.MAI 596 75.XX.XX.XX DATA DATA 354 Start mail input; end with <CRLF>.<CRLF> 46 6 no-reply@mydomain.com
09/01/13 15:07:27 SMTP-OU D65C7059FE274FBCBA296953ABA4221F.MAI 780 50.XX.XX.XX CONN 220 recipientserver.com ESMTP MailEnable Service, Version: 6.53-- ready at 09/01/13 15:07:26 0 86
09/01/13 15:07:27 SMTP-OU D65C7059FE274FBCBA296953ABA4221F.MAI 780 50.XX.XX.XX EHLO EHLO mydomain.com 250-recipientserver.com [75.XX.XX.XX], this server offers 4 extensions 18 127
09/01/13 15:07:27 SMTP-OU D65C7059FE274FBCBA296953ABA4221F.MAI 780 50.XX.XX.XX MAIL MAIL FROM:<no-reply@mydomain.com> SIZE=423 551 This mail server requires authentication before sending mail from a locally hosted domain. Please reconfigure your mail client to authenticate before sending mail. 43 169
09/01/13 15:07:27 SMTP-OU D65C7059FE274FBCBA296953ABA4221F.MAI 780 50.XX.XX.XX QUIT QUIT 221 Service closing transmission channel 6 42
09/01/13 15:07:28 SMTP-IN 8E182A43292745538949A1160E407982.MAI 780 127.0.0.1 220 mydomain.com ESMTP MailEnable Service, Version: 7.0-- ready at 09/01/13 15:07:28 0 0
09/01/13 15:07:28 SMTP-OU D65C7059FE274FBCBA296953ABA4221F.MAI 576 127.0.0.1 CONN 220 mydomain.com ESMTP MailEnable Service, Version: 7.0-- ready at 09/01/13 15:07:28 0 85
09/01/13 15:07:28 SMTP-IN 8E182A43292745538949A1160E407982.MAI 780 127.0.0.1 EHLO EHLO mydomain.com 250-mydomain.com [127.0.0.1], this server offers 4 extensions 123 18
09/01/13 15:07:28 SMTP-OU D65C7059FE274FBCBA296953ABA4221F.MAI 576 127.0.0.1 EHLO EHLO mydomain.com 250-mydomain.com [127.0.0.1], this server offers 4 extensions 18 123
09/01/13 15:07:28 SMTP-IN 8E182A43292745538949A1160E407982.MAI 780 127.0.0.1 MAIL MAIL FROM:<> SIZE=1052 250 Requested mail action okay, completed 43 24
09/01/13 15:07:28 SMTP-OU D65C7059FE274FBCBA296953ABA4221F.MAI 576 127.0.0.1 MAIL MAIL FROM:<> SIZE=1052 250 Requested mail action okay, completed 24 43
09/01/13 15:07:28 SMTP-IN 8E182A43292745538949A1160E407982.MAI 780 127.0.0.1 RCPT RCPT TO:<no-reply@mydomain.com> 250 Requested mail action okay, completed 43 32
09/01/13 15:07:28 SMTP-OU D65C7059FE274FBCBA296953ABA4221F.MAI 576 127.0.0.1 RCPT RCPT TO:<no-reply@mydomain.com> 250 Requested mail action okay, completed 32 43
09/01/13 15:07:28 SMTP-IN 8E182A43292745538949A1160E407982.MAI 780 127.0.0.1 DATA DATA 354 Start mail input; end with <CRLF>.<CRLF> 46 6
09/01/13 15:07:28 SMTP-OU D65C7059FE274FBCBA296953ABA4221F.MAI 576 127.0.0.1 DATA DATA 354 Start mail input; end with <CRLF>.<CRLF> 6 46
09/01/13 15:07:28 SMTP-OU D65C7059FE274FBCBA296953ABA4221F.MAI 576 127.0.0.1 DATE 250 Requested mail action okay, completed 1063 43
09/01/13 15:07:28 SMTP-IN 05D1026706304C7F941CD6348057CC71.MAI 780 127.0.0.1 QUIT QUIT 221 Service closing transmission channel 42 6
09/01/13 15:07:28 SMTP-OU D65C7059FE274FBCBA296953ABA4221F.MAI 576 127.0.0.1 QUIT QUIT 221 Service closing transmission channel 6 42 调试:
09/01/13 15:07:26 ME-I0135: Authenticating User:no-reply@mydomain.com using Authentication Provider Credentials
09/01/13 15:07:26 ME-I0107: [596] Relay Granted: Sender IP (75.xx.xx.xx) is within an authorized IP range.
09/01/13 15:07:26 ME-I0101: [596] Local Delivery: Address ([SMTP:mydomainBCC@mydomain.com]) is local.
09/01/13 15:07:26 ME-I0149: [596] 5300BA9154CC413AAD202DE4FBA6CB71.MAI was received successfully and delivery thread was initiated
09/01/13 15:07:26 ME-E0070: (recv) socket [596] error during [DATA] command from host 75.xx.xx.xx. Socket was disconnected - Error: (10054)
09/01/13 15:07:26 ME-I0074: [596] (Debug) End of conversation
09/01/13 15:07:27 ME-I0018: [2B8847ABCC1242EDBF3417D32DA6DB59.MAI] Outbound message from ([SMTP:no-reply@mydomain.com]) requeued as [D65C7059FE274FBCBA296953ABA4221F.MAI] to the target domain [otherdomain.com]
09/01/13 15:07:27 ME-I0123: Domain [otherdomain.com] has MX list [mail.otherdomain.com]
09/01/13 15:07:27 ME-I0026: [D65C7059FE274FBCBA296953ABA4221F.MAI] Sending message
09/01/13 15:07:27 ME-IXXXX: [D65C7059FE274FBCBA296953ABA4221F.MAI] DNS resolved to the following record: IP Address=50.XX.XX.XX, Family=2, Type=1, Protocol=6
09/01/13 15:07:27 ME-IXXXX: [D65C7059FE274FBCBA296953ABA4221F.MAI] Remote server returned a response indicating a permanent error. Server Response: (551 This mail server requires authentication before sending mail from a locally hosted domain. Please reconfigure your mail client to authenticate before sending mail.**)
09/01/13 15:07:27 ME-E0036: [D65C7059FE274FBCBA296953ABA4221F.MAI] MAIL FROM command Failed.
09/01/13 15:07:27 ME-E0008: [D65C7059FE274FBCBA296953ABA4221F.MAI] Outbound, could not send the command to the server (error 10038).
09/01/13 15:07:27 ME-E0060: [D65C7059FE274FBCBA296953ABA4221F.MAI] - Message could not be delivered to target domain (otherdomain.com). Message returned to Sender.
09/01/13 15:07:28 ME-I0119: Domain [mydomain.com] has used local loopback address [127.0.0.1] because it is hosted locally.
09/01/13 15:07:28 ME-I0026: [D65C7059FE274FBCBA296953ABA4221F.MAI] Sending message
09/01/13 15:07:28 ME-IXXXX: [D65C7059FE274FBCBA296953ABA4221F.MAI] DNS resolved to the following record: IP Address=127.0.0.1, Family=2, Type=1, Protocol=0
09/01/13 15:07:28 ME-I0101: [780] Local Delivery: Address ([SMTP:no-reply@mydomain.com]) is local.
09/01/13 15:07:28 ME-I0149: [780] 8E182A43292745538949A1160E407982.MAI was received successfully and delivery thread was initiated
09/01/13 15:07:28 ME-I0049: [D65C7059FE274FBCBA296953ABA4221F.MAI] Send Completed Successfully
09/01/13 15:07:28 ME-I0074: [780] (Debug) End of conversation发布于 2013-09-01 21:53:29
好吧,发现问题了。我用来测试问题的“外部”地址实际上是在我们的网站转移到这个专用服务器之前所在的旧服务器上。显然,该服务器上的站点/邮件设置在我们的站点上,一旦我们移出它,就永远不会被删除。因此,当我们的新服务器发送或从我们的新服务器发送到仍然承载在旧服务器上的地址时,旧服务器将电子邮件解释为来自未经身份验证的内部地址。
https://stackoverflow.com/questions/18562790
复制相似问题