3

在德尔福体育俱乐部会员计划中,我使用俱乐部的 BTConnect 帐户向会员发送大量电子邮件,该帐户已迁移到 Office365。最近,BT 提高了身份验证,我将 SMTP 参数从 satNone 更改为 satDefault 和 utUseExplicitTLS。如果我在家运行程序,它会按预期工作:

Stat Connected.
Recv 20/11/2012 16:36:02: 220 pod51016.outlook.com Microsoft ESMTP MAIL Service ready at Tue, 20 Nov 2012 16:36:01 +0000<EOL>
Sent 20/11/2012 16:36:02: EHLO macxp<EOL>
Recv 20/11/2012 16:36:02: 250-pod51016.outlook.com Hello [81.155.5.61]<EOL>250-SIZE 36700160<EOL>250-PIPELINING<EOL>250-DSN<EOL>250-ENHANCEDSTATUSCODES<EOL>250-STARTTLS<EOL>250-AUTH<EOL>250-8BITMIME<EOL>250-BINARYMIME<EOL>250 CHUNKING<EOL>
Sent 20/11/2012 16:36:02: STARTTLS<EOL>
Recv 20/11/2012 16:36:02: 220 2.0.0 SMTP server ready<EOL>
Sent 20/11/2012 16:36:02: EHLO macxp<EOL>
Recv 20/11/2012 16:36:02: 250-pod51016.outlook.com Hello [81.155.5.61]<EOL>250-SIZE 36700160<EOL>250-PIPELINING<EOL>250-DSN<EOL>250-ENHANCEDSTATUSCODES<EOL>250-AUTH LOGIN<EOL>250-8BITMIME<EOL>250-BINARYMIME<EOL>250 CHUNKING<EOL>
Sent 20/11/2012 16:36:02: AUTH LOGIN<EOL>
Recv 20/11/2012 16:36:02: 334 deleted<EOL>
Sent 20/11/2012 16:36:02: deleted<EOL>
Recv 20/11/2012 16:36:02: 334 deleted<EOL>
Sent 20/11/2012 16:36:02: deleted<EOL>
Recv 20/11/2012 16:36:04: 235 2.7.0 Authentication successful<EOL>
Sent 20/11/2012 16:36:04: RSET<EOL>
Recv 20/11/2012 16:36:10: 250 2.0.0 Resetting<EOL>
Sent 20/11/2012 16:36:10: MAIL FROM: <deleted@btconnect.com><EOL>
Recv 20/11/2012 16:36:10: 250 2.1.0 Sender OK<EOL>  

就这样,没问题。如果我将程序带到体育俱乐部并在那里运行,我会得到:

Stat Connected.
Recv 12/11/2012 15:17:31: 220 pod51014.outlook.com Microsoft ESMTP MAIL Service ready at Mon, 12 Nov 2012 15:17:03 +0000<EOL>
Sent 12/11/2012 15:17:31: EHLO ovscbob<EOL>
Recv 12/11/2012 15:17:31: 250-pod51014.outlook.com Hello [81.149.229.105]<EOL>250-SIZE 36700160<EOL>250-PIPELINING<EOL>250-DSN<EOL>250-ENHANCEDSTATUSCODES<EOL>250-STARTTLS<EOL>250-AUTH<EOL>250-8BITMIME<EOL>250-BINARYMIME<EOL>250 CHUNKING<EOL>
Sent 12/11/2012 15:17:31: STARTTLS<EOL>
Recv 12/11/2012 15:17:31: 220 2.0.0 SMTP server ready<EOL>
Sent 12/11/2012 15:17:31: QUIT<EOL>
Stat Disconnected.

似乎 Indy 发出的是 QUIT 而不是第二个 EHLO 命令,但我不知道为什么。我将设置更改为使用 satSASL 和相关机制,结果相同。它在家里工作得很好,但在俱乐部里却不行。有什么办法可以解决这个问题吗?大约一周前,我也将 Indy 更新到了最新版本。

谢谢

4

1 回答 1

2

当服务器接收到STARTTLS命令并回复成功响应时,它希望TIdSMTP在发送任何进一步的命令之前启动 SSL/TLS 握手。在这种情况下,SSL/TLS 握手必须失败,并且应该引发异常。 发生异常时TIdSMTPBase.StartTLS()调用。这是在成功命令后发送命令Disconnect()的唯一方法,而不是发送第二个.TIdSMTPQUITSTARTTLSEHLO

于 2012-11-20T23:38:35.150 回答