aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPavel Volgarev <pvolgarev@google.com>2020-01-14 17:22:38 -0500
committerDaniel Stenberg <daniel@haxx.se>2020-01-21 10:40:19 +0100
commit4a4609bf3c812afc65f700b4b7e673cc76ade1bf (patch)
treead7428b01b7bdd0735670f2cdbe6af46a11f97ba /src
parent23a17e039d0b1f0491d420ce2fd06e23cb3cf4c6 (diff)
smtp: Allow RCPT TO command to fail for some recipients
Introduces CURLOPT_MAIL_RCPT_ALLLOWFAILS. Verified with the new tests 3002-3007 Closes #4816
Diffstat (limited to 'src')
-rw-r--r--src/tool_cfgable.h3
-rw-r--r--src/tool_getparam.c4
-rw-r--r--src/tool_help.c4
-rw-r--r--src/tool_operate.c4
4 files changed, 13 insertions, 2 deletions
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h
index 32e811eaa..e093b2c84 100644
--- a/src/tool_cfgable.h
+++ b/src/tool_cfgable.h
@@ -7,7 +7,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -108,6 +108,7 @@ struct OperationConfig {
char *mail_from;
struct curl_slist *mail_rcpt;
char *mail_auth;
+ bool mail_rcpt_allowfails; /* --mail-rcpt-allowfails */
char *sasl_authzid; /* Authorisation identity (identity to use) */
bool sasl_ir; /* Enable/disable SASL initial response */
bool proxytunnel;
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 8df6e5e24..b757ac8f0 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -273,6 +273,7 @@ static const struct LongShort aliases[]= {
{"f", "fail", ARG_BOOL},
{"fa", "fail-early", ARG_BOOL},
{"fb", "styled-output", ARG_BOOL},
+ {"fc", "mail-rcpt-allowfails", ARG_BOOL},
{"F", "form", ARG_STRING},
{"Fs", "form-string", ARG_STRING},
{"g", "globoff", ARG_BOOL},
@@ -1722,6 +1723,9 @@ ParameterError getparameter(const char *flag, /* f or -long-flag */
case 'b': /* --styled-output */
global->styled_output = toggle;
break;
+ case 'c': /* --mail-rcpt-allowfails */
+ config->mail_rcpt_allowfails = toggle;
+ break;
default: /* --fail (hard on errors) */
config->failonerror = toggle;
}
diff --git a/src/tool_help.c b/src/tool_help.c
index 8d3f34547..9ee99d174 100644
--- a/src/tool_help.c
+++ b/src/tool_help.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2019, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -239,6 +239,8 @@ static const struct helptxt helptext[] = {
"Mail from this address"},
{" --mail-rcpt <address>",
"Mail to this address"},
+ {" --mail-rcpt-allowfails",
+ "Allow RCPT TO command to fail for some recipients"},
{"-M, --manual",
"Display the full manual"},
{" --max-filesize <bytes>",
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 2e6563a20..2855f0f8f 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1835,6 +1835,10 @@ static CURLcode single_transfer(struct GlobalConfig *global,
if(config->mail_rcpt)
my_setopt_slist(curl, CURLOPT_MAIL_RCPT, config->mail_rcpt);
+ /* curl 7.69.x */
+ my_setopt(curl, CURLOPT_MAIL_RCPT_ALLLOWFAILS,
+ config->mail_rcpt_allowfails ? 1L : 0L);
+
/* curl 7.20.x */
if(config->ftp_pret)
my_setopt(curl, CURLOPT_FTP_USE_PRET, 1L);