Commit 3c8c9b27 authored by Steve Holme's avatar Steve Holme
Browse files

smtp: Changed the default command to HELP when no options are specified

Otherwise a NOOP operation would be performed which a) only returns a
single line response and not a multiline response where -I needs to be
used, and b) provides an inconsistent user experience compared to that
of the POP3 and IMAP protocols.
parent b27dc009
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -1801,7 +1801,7 @@ Specifies a custom POP3 command to use instead of LIST or RETR. (Added in
Specifies a custom IMAP command to use insead of LIST. (Added in 7.30.0)
Specifies a custom IMAP command to use insead of LIST. (Added in 7.30.0)


(SMTP)
(SMTP)
Specifies a custom SMTP command to use instead of VRFY or NOOP. (Added in 7.34.0)
Specifies a custom SMTP command to use instead of HELP or VRFY. (Added in 7.34.0)


If this option is used several times, the last one will be used.
If this option is used several times, the last one will be used.
.IP "--xattr"
.IP "--xattr"
+7 −8
Original line number Original line Diff line number Diff line
@@ -2084,11 +2084,11 @@ Instead of LIST and NLST when performing FTP directory listings.


.B IMAP
.B IMAP


Instead of LIST when issuing IMAP based commands. (Added in 7.30.0)
Instead of LIST when issuing IMAP based requests. (Added in 7.30.0)


.B POP3
.B POP3


Instead of LIST and RETR when issuing POP3 based commands. (Added in 7.26.0)
Instead of LIST and RETR when issuing POP3 based requests. (Added in 7.26.0)


For example:
For example:


@@ -2099,15 +2099,14 @@ DELE and NOOP for example.


.B SMTP
.B SMTP


When you tell libcurl to use a custom request it will behave as a NOOP or VRFY
Instead of a HELP or VRFY when issuing SMTP based requests. (Added in 7.34.0)
request depending on what other options are set. (Added in 7.34.0)


For example:
For example:


If the \fICURLOPT_NOBODY\fP option is specified then the request can be used to
Normally a multiline response is returned which can be used, in conjuection with
specify the RSET command. Otherwise a multiline listing is returned which can
\fICURLOPT_MAIL_RCPT\fP, to specify an EXPN request. If the \fICURLOPT_NOBODY\fP
be used to specify a HELP request or, if used in conjuection with the
option is specified then the request can be used to issue NOOP and RSET
\fICURLOPT_MAIL_RCPT\fP option, a EXPN request.
commands.
.IP CURLOPT_FILETIME
.IP CURLOPT_FILETIME
Pass a long. If it is 1, libcurl will attempt to get the modification date of
Pass a long. If it is 1, libcurl will attempt to get the modification date of
the remote document in this operation. This requires that the remote server
the remote document in this operation. This requires that the remote server
+2 −2
Original line number Original line Diff line number Diff line
@@ -571,8 +571,8 @@ static CURLcode smtp_perform_command(struct connectdata *conn)
    /* Send the VRFY command */
    /* Send the VRFY command */
    result = Curl_pp_sendf(&conn->proto.smtpc.pp, "VRFY %s", smtp->rcpt->data);
    result = Curl_pp_sendf(&conn->proto.smtpc.pp, "VRFY %s", smtp->rcpt->data);
  else
  else
    /* Send the NOOP command */
    /* Send the HELP command */
    result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "NOOP");
    result = Curl_pp_sendf(&conn->proto.smtpc.pp, "%s", "HELP");


  if(!result)
  if(!result)
    state(conn, SMTP_COMMAND);
    state(conn, SMTP_COMMAND);