1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

first shot at actually doing the SMTP upload as well, not doing the proper

end-of-body treatment
This commit is contained in:
Daniel Stenberg 2009-12-25 22:50:11 +00:00
parent 73ad32e125
commit a218235964

View File

@ -321,7 +321,7 @@ static CURLcode smtp_mail(struct connectdata *conn)
struct SessionHandle *data = conn->data; struct SessionHandle *data = conn->data;
/* send MAIL */ /* send MAIL */
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:<%s>", result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:%s",
data->set.str[STRING_MAIL_FROM]); data->set.str[STRING_MAIL_FROM]);
if(result) if(result)
return result; return result;
@ -346,7 +346,7 @@ static CURLcode smtp_state_mail_resp(struct connectdata *conn,
} }
else { else {
/* send RCPT TO */ /* send RCPT TO */
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:<%s>", result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:%s",
data->set.str[STRING_MAIL_RCPT]); data->set.str[STRING_MAIL_RCPT]);
if(result) if(result)
return result; return result;
@ -392,15 +392,14 @@ static CURLcode smtp_state_data_resp(struct connectdata *conn,
(void)instate; /* no use for this yet */ (void)instate; /* no use for this yet */
if(smtpcode/100 != 2) { if(smtpcode != 354) {
state(conn, SMTP_STOP); state(conn, SMTP_STOP);
return CURLE_RECV_ERROR; return CURLE_RECV_ERROR;
} }
/* SMTP upload */ /* SMTP upload */
result=Curl_setup_transfer(conn, FIRSTSOCKET, -1, FALSE, result = Curl_setup_transfer(conn, -1, -1, FALSE, NULL, /* no download */
smtp->bytecountp, FIRSTSOCKET, smtp->bytecountp);
-1, NULL); /* no upload here */
state(conn, SMTP_STOP); state(conn, SMTP_STOP);
return result; return result;