2

I'm implementing SMTP client. What should the client do once it already sent the "." at the end of the mail, but didn't receive "250 Ok"?

This is how the conversation between the client and server look like:

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

I'm not sure what should I do if the client sends "." and doesn't receive the 250 Ok - because of possible network error. Was the "." sent or not? Should the client resend the mail - and - maybe - duplicate the item, or not - and risk in losing an important mail item?

Thank you.

7
  • Good question, I would like to hear an answer for this too!
    – Léo Natan
    Nov 6, 2013 at 15:28
  • Are you building this as part of a server or on the client programmer side?
    – random
    Nov 7, 2013 at 3:59
  • @random Hi. I have modified the question and tried to make it clearer. This is a client side program. It is stated in the question "SMTP Client" in the first line.
    – orif
    Nov 7, 2013 at 9:06
  • Wikipedia says, “Until the sender has received that 250 reply [the server’s positive reply to the end-of-data], it must assume the message was not delivered.” and “A message can be doubled if there is a communication failure at this time, …” Nov 7, 2013 at 16:15
  • The only proper answer is "Read the specifications for the SMTP protocol" (ietf.org/rfc/rfc2821.txt). Yes it is dull and boring but that's the only place you'll find the right answers.
    – Mokubai
    Nov 7, 2013 at 19:07

0

Browse other questions tagged .