Loading lib/smtp.c +13 −3 Original line number Diff line number Diff line Loading @@ -248,11 +248,10 @@ static void state(struct connectdata *conn, static CURLcode smtp_state_ehlo(struct connectdata *conn) { CURLcode result; struct FTP *smtp = conn->data->state.proto.smtp; struct smtp_conn *smtpc = &conn->proto.smtpc; /* send EHLO */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "EHLO %s", smtp->user?smtp->user:""); result = Curl_pp_sendf(&conn->proto.smtpc.pp, "EHLO %s", smtpc->domain); if(result) return result; Loading Loading @@ -545,6 +544,8 @@ static CURLcode smtp_connect(struct connectdata *conn, struct smtp_conn *smtpc = &conn->proto.smtpc; struct SessionHandle *data=conn->data; struct pingpong *pp=&smtpc->pp; const char *path = conn->data->state.path; int len; *done = FALSE; /* default to not done yet */ Loading Loading @@ -609,6 +610,12 @@ static CURLcode smtp_connect(struct connectdata *conn, pp->endofresp = smtp_endofresp; pp->conn = conn; if(!*path) path = "localhost"; /* url decode the path and use it as domain with EHLO */ smtpc->domain = curl_easy_unescape(conn->data, path, 0, &len); /* When we connect, we start in the state where we await the server greeting */ state(conn, SMTP_SERVERGREET); Loading Loading @@ -801,12 +808,15 @@ static CURLcode smtp_dophase_done(struct connectdata *conn, { CURLcode result = CURLE_OK; struct FTP *smtp = conn->data->state.proto.smtp; struct smtp_conn *smtpc= &conn->proto.smtpc; (void)connected; if(smtp->transfer != FTPTRANSFER_BODY) /* no data to transfer */ result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); free(smtpc->domain); return result; } Loading tests/data/test802 +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ To: another body </stdin> <command> smtp://%HOSTIP:%SMTPPORT -u user:secret --mail-rcpt 802@foo --mail-from 802@from -T - smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 802@foo --mail-from 802@from -T - </command> </client> Loading tests/data/test803 +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ To: another body </stdin> <command> smtp://%HOSTIP:%SMTPPORT -u user:secret --mail-rcpt 803@foo --mail-from 803@from -T - smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 803@foo --mail-from 803@from -T - </command> </client> Loading lib/smtp.h +3 −3 File changed.Contains only whitespace changes. Show changes Loading
lib/smtp.c +13 −3 Original line number Diff line number Diff line Loading @@ -248,11 +248,10 @@ static void state(struct connectdata *conn, static CURLcode smtp_state_ehlo(struct connectdata *conn) { CURLcode result; struct FTP *smtp = conn->data->state.proto.smtp; struct smtp_conn *smtpc = &conn->proto.smtpc; /* send EHLO */ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "EHLO %s", smtp->user?smtp->user:""); result = Curl_pp_sendf(&conn->proto.smtpc.pp, "EHLO %s", smtpc->domain); if(result) return result; Loading Loading @@ -545,6 +544,8 @@ static CURLcode smtp_connect(struct connectdata *conn, struct smtp_conn *smtpc = &conn->proto.smtpc; struct SessionHandle *data=conn->data; struct pingpong *pp=&smtpc->pp; const char *path = conn->data->state.path; int len; *done = FALSE; /* default to not done yet */ Loading Loading @@ -609,6 +610,12 @@ static CURLcode smtp_connect(struct connectdata *conn, pp->endofresp = smtp_endofresp; pp->conn = conn; if(!*path) path = "localhost"; /* url decode the path and use it as domain with EHLO */ smtpc->domain = curl_easy_unescape(conn->data, path, 0, &len); /* When we connect, we start in the state where we await the server greeting */ state(conn, SMTP_SERVERGREET); Loading Loading @@ -801,12 +808,15 @@ static CURLcode smtp_dophase_done(struct connectdata *conn, { CURLcode result = CURLE_OK; struct FTP *smtp = conn->data->state.proto.smtp; struct smtp_conn *smtpc= &conn->proto.smtpc; (void)connected; if(smtp->transfer != FTPTRANSFER_BODY) /* no data to transfer */ result=Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL); free(smtpc->domain); return result; } Loading
tests/data/test802 +1 −1 Original line number Diff line number Diff line Loading @@ -26,7 +26,7 @@ To: another body </stdin> <command> smtp://%HOSTIP:%SMTPPORT -u user:secret --mail-rcpt 802@foo --mail-from 802@from -T - smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 802@foo --mail-from 802@from -T - </command> </client> Loading
tests/data/test803 +1 −1 Original line number Diff line number Diff line Loading @@ -32,7 +32,7 @@ To: another body </stdin> <command> smtp://%HOSTIP:%SMTPPORT -u user:secret --mail-rcpt 803@foo --mail-from 803@from -T - smtp://%HOSTIP:%SMTPPORT/user --mail-rcpt 803@foo --mail-from 803@from -T - </command> </client> Loading