SMTP 客户端实现

SMTP 客户端实现

我正在实现 SMTP 客户端。如果客户端已发送邮件末尾的“.”,但没有收到“250 Ok”,该怎么办?

客户端和服务器之间的对话如下:

Server Response: 220 www.sample.com ESMTP Postfix
Client Sending : HELO domain.com
Server Response: 250 Hello domain.com
Client Sending : MAIL FROM: <[email protected]>
Server Response: 250 Ok
Client Sending : RCPT TO: <[email protected]>
Server Response: 250 Ok
Client Sending : DATA
Server Response: 354 End data with <CR><LF>.<CR><LF>
Client Sending : Subject: Example Message
Client Sending : From: [email protected]
Client Sending : To: [email protected]
Client Sending :
Client Sending : TEST MAIL
Client Sending : 
Client Sending : .
Server Response: 250 Ok: queued as 23411
Client Sending : QUIT

如果客户端发送了“。”但因为网络错误而没有收到 250 Ok,我不确定该怎么办。“。”发送了吗?客户端是否应该重新发送邮件 - 并且 - 可能 - 复制邮件,或者不发送 - 并冒着丢失重要邮件的风险?

谢谢。

相关内容