summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2013-11-17 16:39:02 +0000
committerSteve Holme <steve_holme@hotmail.com>2013-11-17 16:39:02 +0000
commit8191800a0c8ff7b262535cbf1311d93ada2ee0c4 (patch)
tree8b11d0ae666d62eb07cbe1999bac17e60b00085d /lib
parent2165298fe6213609460345e466e3ca9d94324965 (diff)
downloadcurl-8191800a0c8ff7b262535cbf1311d93ada2ee0c4.tar.gz
smtp: Fixed space being sent in non --mail-rcpt based requests
Commands such as NOOP, RSET and HELP would be sent with a space at the end of the command, for example: "NOOP ".
Diffstat (limited to 'lib')
-rw-r--r--lib/smtp.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index 5675ff4ee..aa3ff326a 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -563,16 +563,16 @@ static CURLcode smtp_perform_command(struct connectdata *conn)
struct SessionHandle *data = conn->data;
struct SMTP *smtp = data->req.protop;
- if(smtp->custom && smtp->custom[0] != '\0')
- /* Send the custom command */
- result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s %s", smtp->custom,
- smtp->rcpt ? smtp->rcpt->data : "");
- else if(smtp->rcpt)
- /* Send the VRFY command */
- result = Curl_pp_sendf(&conn->proto.smtpc.pp, "VRFY %s", smtp->rcpt->data);
+ /* Send the command */
+ if(smtp->rcpt)
+ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s %s",
+ smtp->custom && smtp->custom[0] != '\0' ?
+ smtp->custom : "VRFY",
+ smtp->rcpt->data);
else
- /* Send the HELP command */
- result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "HELP");
+ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s",
+ smtp->custom && smtp->custom[0] != '\0' ?
+ smtp->custom : "HELP");
if(!result)
state(conn, SMTP_COMMAND);