diff --git a/lib/pop3.c b/lib/pop3.c index 8c2c9bb5a6a01adc71b8d37cb15d5013ca2931b4..dc66bcb19154d8b5ca1e2370215f6b74dfd4e5fb 100644 --- a/lib/pop3.c +++ b/lib/pop3.c @@ -260,8 +260,12 @@ static int pop3_endofresp(struct pingpong *pp, int *resp) return TRUE; } + /* Does the server support the STLS capability? */ + if(len >= 4 && !memcmp(line, "STLS", 4)) + pop3c->tls_supported = TRUE; + /* Does the server support clear text authentication? */ - if(len >= 4 && !memcmp(line, "USER", 4)) + else if(len >= 4 && !memcmp(line, "USER", 4)) pop3c->authtypes |= POP3_TYPE_CLEARTEXT; /* Does the server support APOP authentication? */ diff --git a/lib/pop3.h b/lib/pop3.h index b9d7bd4e66df9fcac698457f08d520efe725eadd..c37b009ddff6c016993a8693f8c2fbc6b5e0d5cb 100644 --- a/lib/pop3.h +++ b/lib/pop3.h @@ -66,6 +66,7 @@ struct pop3_conn { char *apoptimestamp; /* APOP timestamp from the server greeting */ pop3state state; /* Always use pop3.c:state() to change state! */ bool ssldone; /* Is connect() over SSL done? */ + bool tls_supported; /* StartTLS capability supported by server */ }; extern const struct Curl_handler Curl_handler_pop3;