static CURLcode smtp_perform_authenticate(struct connectdata *conn)
{
CURLcode result = CURLE_OK;
+ struct SessionHandle *data = conn->data;
struct smtp_conn *smtpc = &conn->proto.smtpc;
const char *mech = NULL;
char *initresp = NULL;
state1 = SMTP_AUTH_NTLM;
state2 = SMTP_AUTH_NTLM_TYPE2MSG;
smtpc->authused = SASL_MECH_NTLM;
- result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd,
- &conn->ntlm,
- &initresp, &len);
- }
+
+ if(data->set.sasl_ir)
+ result = Curl_sasl_create_ntlm_type1_message(conn->user, conn->passwd,
+ &conn->ntlm,
+ &initresp, &len);
+ }
else
#endif
if((smtpc->authmechs & SASL_MECH_LOGIN) &&
state1 = SMTP_AUTH_LOGIN;
state2 = SMTP_AUTH_LOGIN_PASSWD;
smtpc->authused = SASL_MECH_LOGIN;
- result = Curl_sasl_create_login_message(conn->data, conn->user,
- &initresp, &len);
+
+ if(data->set.sasl_ir)
+ result = Curl_sasl_create_login_message(conn->data, conn->user,
+ &initresp, &len);
}
else if((smtpc->authmechs & SASL_MECH_PLAIN) &&
(smtpc->prefmech & SASL_MECH_PLAIN)) {
state1 = SMTP_AUTH_PLAIN;
state2 = SMTP_AUTH_FINAL;
smtpc->authused = SASL_MECH_PLAIN;
- result = Curl_sasl_create_plain_message(conn->data, conn->user,
- conn->passwd, &initresp, &len);
+
+ if(data->set.sasl_ir)
+ result = Curl_sasl_create_plain_message(conn->data, conn->user,
+ conn->passwd, &initresp, &len);
}
else {
/* Other mechanisms not supported */