From ec3bb8f727405642a471b4b1b9eb0118fc003104 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 12 Dec 2009 21:54:01 +0000 Subject: introducing IMAP, POP3 and SMTP support (still lots of polish left to do) --- src/main.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index 47e25fb7e..f7c2eb43e 100644 --- a/src/main.c +++ b/src/main.c @@ -500,6 +500,8 @@ struct Configurable { char *proxy; int proxyver; /* set to CURLPROXY_HTTP* define */ char *noproxy; + char *mail_from; + char *mail_rcpt; bool proxytunnel; bool ftp_append; /* APPE on ftp */ bool mute; /* shutup */ @@ -822,6 +824,8 @@ static void help(void) " -L/--location Follow Location: hints (H)", " --location-trusted Follow Location: and send auth to other hosts (H)", " -M/--manual Display the full manual", + " --mail-from Mail from this address", + " --mail-rcpt Mail to this receiver(s)", " --max-filesize Maximum file size to download (H/F)", " --max-redirs Maximum number of redirects allowed (H)", " -m/--max-time Maximum time allowed for the transfer", @@ -1740,6 +1744,8 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ #endif {"$8", "proxy1.0", TRUE}, {"$9", "tftp-blksize", TRUE}, + {"$A", "mail-from", TRUE}, + {"$B", "mail-rcpt", TRUE}, {"0", "http1.0", FALSE}, {"1", "tlsv1", FALSE}, {"2", "sslv2", FALSE}, @@ -2269,6 +2275,12 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ case '9': /* --tftp-blksize */ str2num(&config->tftp_blksize, nextarg); break; + case 'A': /* --mail-from */ + GetStr(&config->mail_from, nextarg); + break; + case 'B': /* --mail-rcpt */ + GetStr(&config->mail_rcpt, nextarg); + break; } break; case '#': /* --progress-bar */ @@ -5006,9 +5018,16 @@ operate(struct Configurable *config, int argc, argv_item_t argv[]) my_setopt(curl, CURLOPT_POSTREDIR, config->post301 | (config->post302 ? CURL_REDIR_POST_302 : FALSE)); + /* curl 7.20.0 */ if(config->tftp_blksize) my_setopt(curl, CURLOPT_TFTP_BLKSIZE, config->tftp_blksize); + if(config->mail_from) + my_setopt_str(curl, CURLOPT_MAIL_FROM, config->mail_from); + + if(config->mail_rcpt) + my_setopt_str(curl, CURLOPT_MAIL_RCPT, config->mail_rcpt); + retry_numretries = config->req_retry; retrystart = cutil_tvnow(); -- cgit v1.2.3