Click here to Skip to main content
15,896,606 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hey guys,
I was wondering what possible scenarios could cause a QUIT (POP3)command to fail? and if it failed to quit, what would be the side effects? for example, does it cause problems with new connection trying to read mails?
Posted
Updated 28-Mar-12 5:56am
v3

1 solution

See RFC 1939[^].

The reason of the failure is usually send with the -ERR response.

The QUIT command may fail if the server can't delete messages that has been marked for deletion with the DELE command. You must assume that no or not all marked messages has been deleted. A new connection should be established without problems.

The QUIT command may also fail if the connection has not been established before (a prior login command returned with an error).
 
Share this answer
 
Comments
soby 28-Mar-12 15:21pm    
From looking at the code it looks like when the QUIT fails there is no response returned or it does not start with '+OK'. I was wondering when could we get the no response situation?

if (response== NULL || _strnicmp(response, "+OK", 3) != 0)
fail = 1;

BTW, when you say "usually" the reason of failur is sent, could you explain what would happen in the rest of the cases in which no -ERR is sent?
Jochen Arndt 29-Mar-12 3:05am    
Your code snippet checks only if the begin of the response string is +OK. If not, an error is assumed. In case of errors it would be helpful to see the complete response string (if not null).

According to the RFC, each command response must begin with +OK or -ERR. Additional describing text is optional. But most server implementations will send additional text. The connect answer of the server usually contains the name and version of the server. You may try to find the source code of your server (many are open source) and analyse the code when receiving the QUIT command.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900