Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ exchange Server
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 28-Mar-12 6:25am
soby210
Edited 28-Mar-12 6:56am
v3

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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).
  Permalink  
Comments
soby at 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 at 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)

  Print Answers RSS
0 Maciej Los 295
1 OriginalGriff 273
2 Aajmot Sk 234
3 Marcin Kozub 205
4 Richard MacCutchan 200
0 OriginalGriff 7,903
1 Sergey Alexandrovich Kryukov 7,127
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,820


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.1 | Last Updated 28 Mar 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100