Lines Matching defs:smtpc
236 struct smtp_conn *smtpc = &conn->proto.smtpc;
257 (smtpc->state == SMTP_EHLO || smtpc->state == SMTP_COMMAND)) {
302 struct smtp_conn *smtpc = &conn->proto.smtpc;
332 if(smtpc->state != newstate)
334 (void *)smtpc, names[smtpc->state], names[newstate]);
337 smtpc->state = newstate;
350 struct smtp_conn *smtpc = &conn->proto.smtpc;
352 smtpc->authmechs = 0; /* No known authentication mechanisms yet */
353 smtpc->authused = 0; /* Clear the authentication mechanism used
355 smtpc->tls_supported = FALSE; /* Clear the TLS capability */
358 result = Curl_pp_sendf(&smtpc->pp, "EHLO %s", smtpc->domain);
375 struct smtp_conn *smtpc = &conn->proto.smtpc;
377 smtpc->authused = 0; /* No authentication mechanism used in smtp
381 result = Curl_pp_sendf(&smtpc->pp, "HELO %s", smtpc->domain);
400 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "STARTTLS");
417 struct smtp_conn *smtpc = &conn->proto.smtpc;
420 result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &smtpc->ssldone);
423 if(smtpc->state != SMTP_UPGRADETLS)
426 if(smtpc->ssldone) {
448 struct smtp_conn *smtpc = &conn->proto.smtpc;
452 result = Curl_pp_sendf(&smtpc->pp, "AUTH %s %s", mech, initresp);
459 result = Curl_pp_sendf(&smtpc->pp, "AUTH %s", mech);
527 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s %s",
532 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s",
569 if(data->set.str[STRING_MAIL_AUTH] && conn->proto.smtpc.authused) {
584 if(conn->proto.smtpc.size_supported && conn->data->set.infilesize > 0) {
597 result = Curl_pp_sendf(&conn->proto.smtpc.pp,
600 result = Curl_pp_sendf(&conn->proto.smtpc.pp,
603 result = Curl_pp_sendf(&conn->proto.smtpc.pp,
606 result = Curl_pp_sendf(&conn->proto.smtpc.pp,
634 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:%s",
637 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:<%s>",
656 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "QUIT");
714 struct smtp_conn *smtpc = &conn->proto.smtpc;
736 smtpc->tls_supported = TRUE;
740 smtpc->size_supported = TRUE;
768 smtpc->authmechs |= SASL_MECH_LOGIN;
770 smtpc->authmechs |= SASL_MECH_PLAIN;
772 smtpc->authmechs |= SASL_MECH_CRAM_MD5;
774 smtpc->authmechs |= SASL_MECH_DIGEST_MD5;
776 smtpc->authmechs |= SASL_MECH_GSSAPI;
778 smtpc->authmechs |= SASL_MECH_EXTERNAL;
780 smtpc->authmechs |= SASL_MECH_NTLM;
782 smtpc->authmechs |= SASL_MECH_XOAUTH2;
792 if(smtpc->tls_supported)
853 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", plainauth);
887 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", authuser);
921 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", authpasswd);
960 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "*");
971 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", rplyb64);
1015 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "*");
1027 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", rplyb64);
1055 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "");
1090 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", type1msg);
1127 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "*");
1139 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", type3msg);
1175 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", xoauth);
1194 struct smtp_conn *smtpc = &conn->proto.smtpc;
1205 smtpc->authmechs ^= smtpc->authused;
1338 result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "DATA");
1400 struct smtp_conn *smtpc = &conn->proto.smtpc;
1401 struct pingpong *pp = &smtpc->pp;
1405 if(smtpc->state == SMTP_UPGRADETLS)
1419 if(smtpc->state != SMTP_QUIT && smtpcode != 1)
1426 switch(smtpc->state) {
1428 result = smtp_state_servergreet_resp(conn, smtpcode, smtpc->state);
1432 result = smtp_state_ehlo_resp(conn, smtpcode, smtpc->state);
1436 result = smtp_state_helo_resp(conn, smtpcode, smtpc->state);
1440 result = smtp_state_starttls_resp(conn, smtpcode, smtpc->state);
1444 result = smtp_state_auth_plain_resp(conn, smtpcode, smtpc->state);
1448 result = smtp_state_auth_login_resp(conn, smtpcode, smtpc->state);
1453 smtpc->state);
1458 result = smtp_state_auth_cram_resp(conn, smtpcode, smtpc->state);
1462 result = smtp_state_auth_digest_resp(conn, smtpcode, smtpc->state);
1466 result = smtp_state_auth_digest_resp_resp(conn, smtpcode, smtpc->state);
1472 result = smtp_state_auth_ntlm_resp(conn, smtpcode, smtpc->state);
1477 smtpc->state);
1482 result = smtp_state_auth_xoauth2_resp(conn, smtpcode, smtpc->state);
1486 result = smtp_state_auth_cancel_resp(conn, smtpcode, smtpc->state);
1490 result = smtp_state_auth_final_resp(conn, smtpcode, smtpc->state);
1494 result = smtp_state_command_resp(conn, smtpcode, smtpc->state);
1498 result = smtp_state_mail_resp(conn, smtpcode, smtpc->state);
1502 result = smtp_state_rcpt_resp(conn, smtpcode, smtpc->state);
1506 result = smtp_state_data_resp(conn, smtpcode, smtpc->state);
1510 result = smtp_state_postdata_resp(conn, smtpcode, smtpc->state);
1520 } while(!result && smtpc->state != SMTP_STOP && Curl_pp_moredata(pp));
1529 struct smtp_conn *smtpc = &conn->proto.smtpc;
1531 if((conn->handler->flags & PROTOPT_SSL) && !smtpc->ssldone) {
1532 result = Curl_ssl_connect_nonblocking(conn, FIRSTSOCKET, &smtpc->ssldone);
1533 if(result || !smtpc->ssldone)
1537 result = Curl_pp_statemach(&smtpc->pp, FALSE);
1538 *done = (smtpc->state == SMTP_STOP) ? TRUE : FALSE;
1546 struct smtp_conn *smtpc = &conn->proto.smtpc;
1548 while(smtpc->state != SMTP_STOP && !result)
1549 result = Curl_pp_statemach(&smtpc->pp, TRUE);
1573 return Curl_pp_getsock(&conn->proto.smtpc.pp, socks, numsocks);
1589 struct smtp_conn *smtpc = &conn->proto.smtpc;
1590 struct pingpong *pp = &smtpc->pp;
1604 smtpc->prefmech = SASL_AUTH_ANY;
1642 struct pingpong *pp = &conn->proto.smtpc.pp;
1791 struct smtp_conn *smtpc = &conn->proto.smtpc;
1799 if(!dead_connection && smtpc->pp.conn && smtpc->pp.conn->bits.protoconnstart)
1804 Curl_pp_disconnect(&smtpc->pp);
1807 Curl_sasl_cleanup(conn, smtpc->authused);
1810 Curl_safefree(smtpc->domain);
1927 struct smtp_conn *smtpc = &conn->proto.smtpc;
1944 smtpc->prefmech = SASL_AUTH_NONE;
1953 smtpc->prefmech = SASL_AUTH_ANY;
1955 smtpc->prefmech |= SASL_MECH_LOGIN;
1957 smtpc->prefmech |= SASL_MECH_PLAIN;
1959 smtpc->prefmech |= SASL_MECH_CRAM_MD5;
1961 smtpc->prefmech |= SASL_MECH_DIGEST_MD5;
1963 smtpc->prefmech |= SASL_MECH_GSSAPI;
1965 smtpc->prefmech |= SASL_MECH_NTLM;
1967 smtpc->prefmech |= SASL_MECH_XOAUTH2;
1989 struct smtp_conn *smtpc = &conn->proto.smtpc;
2002 return Curl_urldecode(conn->data, path, 0, &smtpc->domain, NULL, TRUE);
2038 struct smtp_conn *smtpc = &conn->proto.smtpc;
2043 if((smtpc->authmechs & SASL_MECH_DIGEST_MD5) &&
2044 (smtpc->prefmech & SASL_MECH_DIGEST_MD5)) {
2047 smtpc->authused = SASL_MECH_DIGEST_MD5;
2049 else if((smtpc->authmechs & SASL_MECH_CRAM_MD5) &&
2050 (smtpc->prefmech & SASL_MECH_CRAM_MD5)) {
2053 smtpc->authused = SASL_MECH_CRAM_MD5;
2058 if((smtpc->authmechs & SASL_MECH_NTLM) &&
2059 (smtpc->prefmech & SASL_MECH_NTLM)) {
2063 smtpc->authused = SASL_MECH_NTLM;
2072 if(((smtpc->authmechs & SASL_MECH_XOAUTH2) &&
2073 (smtpc->prefmech & SASL_MECH_XOAUTH2) &&
2074 (smtpc->prefmech != SASL_AUTH_ANY)) || conn->xoauth2_bearer) {
2078 smtpc->authused = SASL_MECH_XOAUTH2;
2085 else if((smtpc->authmechs & SASL_MECH_LOGIN) &&
2086 (smtpc->prefmech & SASL_MECH_LOGIN)) {
2090 smtpc->authused = SASL_MECH_LOGIN;
2095 else if((smtpc->authmechs & SASL_MECH_PLAIN) &&
2096 (smtpc->prefmech & SASL_MECH_PLAIN)) {
2100 smtpc->authused = SASL_MECH_PLAIN;