cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: POP3 Authentication

From: Steve Holme <steve_holme_at_hotmail.com>
Date: Sat, 26 May 2012 09:49:05 +0100

On Fri, 25 May 2012, Steve Holme wrote:

> I will crack on over the weekend then, pushing changes as and
> when I work out the best way to commit what I've done so far.

I am looking for a little bit of feedback and direction from my fellow
hackers, as I need to change/enhance the response detection in
pop3_endofresp() and am wondering what the best thing way forward is.
 
POP3 doesn't support meaningful response codes, like other protocols, when a
command succeeds or fails. It instead can respond with:

+OK Some success message
-ERR Some error message

and just a plus sign on its own. This is used during authentication
negotiation, so for example:

C: AUTH PLAIN
S: +
C: Base64 username and password
S +OK User Logged In

I can detected the + as well as the +OK and -ERR but what should POP3 store
in the resp out parameter so that other functions know if a command has
succeeded or failed?

I believe the options are:

1) Change current response codes to + and - as these are really the
indicator for success and fail
2) Change the response codes to 1 and 0
3) Change the response codes to a HTTP / SMTP equivalent
4) Use 'O' when + is received on its own

Your thoughts and suggestions are welcome.

Thank you

S.

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2012-05-26