Lines Matching defs:imapc
278 struct imap_conn *imapc = &conn->proto.imapc;
279 const char *id = imapc->resptag;
303 switch(imapc->state) {
350 switch(imapc->state) {
415 struct imap_conn *imapc = &conn->proto.imapc;
446 if(imapc->state != newstate)
448 (void *)imapc, names[imapc->state], names[newstate]);
451 imapc->state = newstate;
464 struct imap_conn *imapc = &conn->proto.imapc;
466 imapc->authmechs = 0; /* No known authentication mechanisms yet */
467 imapc->authused = 0; /* Clear the authentication mechanism used */
468 imapc->tls_supported = FALSE; /* Clear the TLS capability */
507 struct imap_conn *imapc = &conn->proto.imapc;
510 result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone);
513 if(imapc->state != IMAP_UPGRADETLS)
516 if(imapc->ssldone) {
605 struct imap_conn *imapc = &conn->proto.imapc;
625 if(mech && (imapc->preftype & IMAP_TYPE_SASL)) {
631 else if((!imapc->login_disabled) &&
632 (imapc->preftype & IMAP_TYPE_CLEARTEXT))
691 struct imap_conn *imapc = &conn->proto.imapc;
695 Curl_safefree(imapc->mailbox);
696 Curl_safefree(imapc->mailbox_uidvalidity);
835 struct imap_conn *imapc = &conn->proto.imapc;
865 imapc->tls_supported = TRUE;
869 imapc->login_disabled = TRUE;
873 imapc->ir_supported = TRUE;
882 imapc->authmechs |= SASL_MECH_LOGIN;
884 imapc->authmechs |= SASL_MECH_PLAIN;
886 imapc->authmechs |= SASL_MECH_CRAM_MD5;
888 imapc->authmechs |= SASL_MECH_DIGEST_MD5;
890 imapc->authmechs |= SASL_MECH_GSSAPI;
892 imapc->authmechs |= SASL_MECH_EXTERNAL;
894 imapc->authmechs |= SASL_MECH_NTLM;
896 imapc->authmechs |= SASL_MECH_XOAUTH2;
905 if(imapc->tls_supported)
971 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", plainauth);
1005 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", authuser);
1039 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", authpasswd);
1078 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", "*");
1089 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", rplyb64);
1133 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", "*");
1145 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", rplyb64);
1173 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", "");
1207 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", type1msg);
1244 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", "*");
1256 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", type3msg);
1293 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", xoauth);
1312 struct imap_conn *imapc = &conn->proto.imapc;
1323 imapc->authmechs ^= imapc->authused;
1337 else if((!imapc->login_disabled) &&
1338 (imapc->preftype & IMAP_TYPE_CLEARTEXT))
1425 struct imap_conn *imapc = &conn->proto.imapc;
1434 Curl_safefree(imapc->mailbox_uidvalidity);
1435 imapc->mailbox_uidvalidity = strdup(tmp);
1440 if(imap->uidvalidity && imapc->mailbox_uidvalidity &&
1441 strcmp(imap->uidvalidity, imapc->mailbox_uidvalidity)) {
1447 imapc->mailbox = strdup(imap->mailbox);
1469 struct imap_conn *imapc = &conn->proto.imapc;
1470 struct pingpong *pp = &imapc->pp;
1625 struct imap_conn *imapc = &conn->proto.imapc;
1626 struct pingpong *pp = &imapc->pp;
1630 if(imapc->state == IMAP_UPGRADETLS)
1651 switch(imapc->state) {
1653 result = imap_state_servergreet_resp(conn, imapcode, imapc->state);
1657 result = imap_state_capability_resp(conn, imapcode, imapc->state);
1661 result = imap_state_starttls_resp(conn, imapcode, imapc->state);
1665 result = imap_state_auth_plain_resp(conn, imapcode, imapc->state);
1669 result = imap_state_auth_login_resp(conn, imapcode, imapc->state);
1674 imapc->state);
1679 result = imap_state_auth_cram_resp(conn, imapcode, imapc->state);
1683 result = imap_state_auth_digest_resp(conn, imapcode, imapc->state);
1687 result = imap_state_auth_digest_resp_resp(conn, imapcode, imapc->state);
1693 result = imap_state_auth_ntlm_resp(conn, imapcode, imapc->state);
1698 imapc->state);
1703 result = imap_state_auth_xoauth2_resp(conn, imapcode, imapc->state);
1707 result = imap_state_auth_cancel_resp(conn, imapcode, imapc->state);
1711 result = imap_state_auth_final_resp(conn, imapcode, imapc->state);
1715 result = imap_state_login_resp(conn, imapcode, imapc->state);
1719 result = imap_state_list_resp(conn, imapcode, imapc->state);
1723 result = imap_state_select_resp(conn, imapcode, imapc->state);
1727 result = imap_state_fetch_resp(conn, imapcode, imapc->state);
1731 result = imap_state_fetch_final_resp(conn, imapcode, imapc->state);
1735 result = imap_state_append_resp(conn, imapcode, imapc->state);
1739 result = imap_state_append_final_resp(conn, imapcode, imapc->state);
1749 } while(!result && imapc->state != IMAP_STOP && Curl_pp_moredata(pp));
1758 struct imap_conn *imapc = &conn->proto.imapc;
1760 if((conn->handler->flags & PROTOPT_SSL) && !imapc->ssldone) {
1761 result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &imapc->ssldone);
1762 if(result || !imapc->ssldone)
1766 result = Curl_pp_statemach(&imapc->pp, FALSE);
1767 *done = (imapc->state == IMAP_STOP) ? TRUE : FALSE;
1775 struct imap_conn *imapc = &conn->proto.imapc;
1777 while(imapc->state != IMAP_STOP && !result)
1778 result = Curl_pp_statemach(&imapc->pp, TRUE);
1802 return Curl_pp_getsock(&conn->proto.imapc.pp, socks, numsocks);
1818 struct imap_conn *imapc = &conn->proto.imapc;
1819 struct pingpong *pp = &imapc->pp;
1833 imapc->preftype = IMAP_TYPE_ANY;
1834 imapc->prefmech = SASL_AUTH_ANY;
1848 strcpy(imapc->resptag, "*");
1891 result = Curl_pp_sendf(&conn->proto.imapc.pp, "%s", "");
1935 struct imap_conn *imapc = &conn->proto.imapc;
1949 if(imap->mailbox && imapc->mailbox &&
1950 !strcmp(imap->mailbox, imapc->mailbox) &&
1951 (!imap->uidvalidity || !imapc->mailbox_uidvalidity ||
1952 !strcmp(imap->uidvalidity, imapc->mailbox_uidvalidity)))
2025 struct imap_conn *imapc = &conn->proto.imapc;
2033 if(!dead_connection && imapc->pp.conn && imapc->pp.conn->bits.protoconnstart)
2038 Curl_pp_disconnect(&imapc->pp);
2041 Curl_sasl_cleanup(conn, imapc->authused);
2044 Curl_safefree(imapc->mailbox);
2045 Curl_safefree(imapc->mailbox_uidvalidity);
2163 struct imap_conn *imapc = &conn->proto.imapc;
2170 imapc->cmdid = (imapc->cmdid + 1) % 1000;
2173 snprintf(imapc->resptag, sizeof(imapc->resptag), "%c%03d",
2174 'A' + curlx_sltosi(conn->connection_id % 26), imapc->cmdid);
2177 taggedfmt = aprintf("%s %s", imapc->resptag, fmt);
2183 result = Curl_pp_vsendf(&imapc->pp, taggedfmt, ap);
2314 struct imap_conn *imapc = &conn->proto.imapc;
2331 imapc->preftype = IMAP_TYPE_NONE;
2332 imapc->prefmech = SASL_AUTH_NONE;
2341 imapc->preftype = IMAP_TYPE_ANY;
2342 imapc->prefmech = SASL_AUTH_ANY;
2345 imapc->preftype = IMAP_TYPE_SASL;
2346 imapc->prefmech |= SASL_MECH_LOGIN;
2349 imapc->preftype = IMAP_TYPE_SASL;
2350 imapc->prefmech |= SASL_MECH_PLAIN;
2353 imapc->preftype = IMAP_TYPE_SASL;
2354 imapc->prefmech |= SASL_MECH_CRAM_MD5;
2357 imapc->preftype = IMAP_TYPE_SASL;
2358 imapc->prefmech |= SASL_MECH_DIGEST_MD5;
2361 imapc->preftype = IMAP_TYPE_SASL;
2362 imapc->prefmech |= SASL_MECH_GSSAPI;
2365 imapc->preftype = IMAP_TYPE_SASL;
2366 imapc->prefmech |= SASL_MECH_NTLM;
2369 imapc->preftype = IMAP_TYPE_SASL;
2370 imapc->prefmech |= SASL_MECH_XOAUTH2;
2543 struct imap_conn *imapc = &conn->proto.imapc;
2548 if((imapc->authmechs & SASL_MECH_DIGEST_MD5) &&
2549 (imapc->prefmech & SASL_MECH_DIGEST_MD5)) {
2552 imapc->authused = SASL_MECH_DIGEST_MD5;
2554 else if((imapc->authmechs & SASL_MECH_CRAM_MD5) &&
2555 (imapc->prefmech & SASL_MECH_CRAM_MD5)) {
2558 imapc->authused = SASL_MECH_CRAM_MD5;
2563 if((imapc->authmechs & SASL_MECH_NTLM) &&
2564 (imapc->prefmech & SASL_MECH_NTLM)) {
2568 imapc->authused = SASL_MECH_NTLM;
2570 if(imapc->ir_supported || data->set.sasl_ir)
2577 if(((imapc->authmechs & SASL_MECH_XOAUTH2) &&
2578 (imapc->prefmech & SASL_MECH_XOAUTH2) &&
2579 (imapc->prefmech != SASL_AUTH_ANY)) || conn->xoauth2_bearer) {
2583 imapc->authused = SASL_MECH_XOAUTH2;
2585 if(imapc->ir_supported || data->set.sasl_ir)
2590 else if((imapc->authmechs & SASL_MECH_LOGIN) &&
2591 (imapc->prefmech & SASL_MECH_LOGIN)) {
2595 imapc->authused = SASL_MECH_LOGIN;
2597 if(imapc->ir_supported || data->set.sasl_ir)
2600 else if((imapc->authmechs & SASL_MECH_PLAIN) &&
2601 (imapc->prefmech & SASL_MECH_PLAIN)) {
2605 imapc->authused = SASL_MECH_PLAIN;
2607 if(imapc->ir_supported || data->set.sasl_ir)