(Winsock) SMTP 服务器没有收到任何东西

(Winsock) SMTP server not receiving anything

我正在尝试使用 Windows Winsock 创建一个简单的 SMTP 服务器,目前它只是一个打印接收到的任何内容的 TCP 服务器。但是,当我连接到它时,它没有收到任何数据;它正在连接但没有别的(甚至没有断开连接的消息)。如果我将端口更改为 25 以外的任何端口,一切正常。该端口已打开并在防火墙中被允许。可能是什么原因?

编辑:找到解决方案,查看我自己的答案。

SMTP protocol 要求 服务器 在客户端可以发送任何命令之前向客户端发送问候语:

3.1. Session Initiation

An SMTP session is initiated when a client opens a connection to a server and the server responds with an opening message.

...

3.2. Client Initiation

Once the server has sent the greeting (welcoming) message and the client has received it, the client normally sends the EHLO command to the server, indicating the client's identity...

...

4.3.1. Sequencing Overview

The communication between the sender and receiver is an alternating dialogue, controlled by the sender. As such, the sender issues a command and the receiver responds with a reply. Unless other arrangements are negotiated through service extensions, the sender MUST wait for this response before sending further commands. One important reply is the connection greeting. Normally, a receiver will send a 220 "Service ready" reply when the connection is completed. The sender SHOULD wait for this greeting message before sending any commands. ...

算了,一直都是诺顿在耍我。如果有人遇到同样的问题,我通过进入 Norton -> Settings -> Antivirus 并关闭 Email Antivirus Scan 来解决它。