aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2012-02-16 13:19:47 +0100
committerDaniel Stenberg <daniel@haxx.se>2012-02-16 13:19:47 +0100
commita053560cfa7d1adb98c833384096fdcf9296b8d2 (patch)
tree1796b306f7b43af93bedb471d338e9a2d0171caf
parent674699b2126ce3a07bbb0a6f1488b934f7f1e5c6 (diff)
curl: Added support for --mail-auth
Added an extra command-line argument to support the optional AUTH parameter in SMTPs MAIL FROM command.
-rw-r--r--src/tool_cfgable.c2
-rw-r--r--src/tool_cfgable.h1
-rw-r--r--src/tool_getparam.c4
-rw-r--r--src/tool_help.c1
-rw-r--r--src/tool_operate.c3
5 files changed, 11 insertions, 0 deletions
diff --git a/src/tool_cfgable.c b/src/tool_cfgable.c
index 2c05c2ec4..98342c4f6 100644
--- a/src/tool_cfgable.c
+++ b/src/tool_cfgable.c
@@ -60,8 +60,10 @@ void free_config_fields(struct Configurable *config)
Curl_safefree(config->proxy);
Curl_safefree(config->noproxy);
+
Curl_safefree(config->mail_from);
curl_slist_free_all(config->mail_rcpt);
+ Curl_safefree(config->mail_auth);
Curl_safefree(config->netrc_file);
diff --git a/src/tool_cfgable.h b/src/tool_cfgable.h
index 6e66191ae..38a71d309 100644
--- a/src/tool_cfgable.h
+++ b/src/tool_cfgable.h
@@ -77,6 +77,7 @@ struct Configurable {
char *noproxy;
char *mail_from;
struct curl_slist *mail_rcpt;
+ char *mail_auth;
bool proxytunnel;
bool ftp_append; /* APPE on ftp */
bool mute; /* don't show messages, --silent given */
diff --git a/src/tool_getparam.c b/src/tool_getparam.c
index 50450c25f..4fe2a6431 100644
--- a/src/tool_getparam.c
+++ b/src/tool_getparam.c
@@ -170,6 +170,7 @@ static const struct LongShort aliases[]= {
{"$E", "proto-redir", TRUE},
{"$F", "resolve", TRUE},
{"$G", "delegation", TRUE},
+ {"$H", "mail-auth", TRUE},
{"0", "http1.0", FALSE},
{"1", "tlsv1", FALSE},
{"2", "sslv2", FALSE},
@@ -813,6 +814,9 @@ ParameterError getparameter(char *flag, /* f or -long-flag */
case 'G': /* --delegation LEVEL */
config->gssapi_delegation = delegation(config, nextarg);
break;
+ case 'H': /* --mail-auth */
+ GetStr(&config->mail_auth, nextarg);
+ break;
}
break;
case '#': /* --progress-bar */
diff --git a/src/tool_help.c b/src/tool_help.c
index 222af4225..31ef1d295 100644
--- a/src/tool_help.c
+++ b/src/tool_help.c
@@ -121,6 +121,7 @@ static const char *const helptext[] = {
" -M, --manual Display the full manual",
" --mail-from FROM Mail from this address",
" --mail-rcpt TO Mail to this receiver(s)",
+ " --mail-auth AUTH Originator address of the original email",
" --max-filesize BYTES Maximum file size to download (H/F)",
" --max-redirs NUM Maximum number of redirects allowed (H)",
" -m, --max-time SECONDS Maximum time allowed for the transfer",
diff --git a/src/tool_operate.c b/src/tool_operate.c
index 53da5f3b5..3e496bfd2 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -1240,6 +1240,9 @@ int operate(struct Configurable *config, int argc, argv_item_t argv[])
if(config->ssl_allow_beast)
my_setopt(curl, CURLOPT_SSL_OPTIONS, (long)CURLSSLOPT_ALLOW_BEAST);
+ if(config->mail_auth)
+ my_setopt_str(curl, CURLOPT_MAIL_AUTH, config->mail_auth);
+
/* initialize retry vars for loop below */
retry_sleep_default = (config->retry_delay) ?
config->retry_delay*1000L : RETRY_SLEEP_DEFAULT; /* ms */