aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/smtp.c19
-rw-r--r--lib/url.c4
-rw-r--r--lib/urldata.h2
3 files changed, 20 insertions, 5 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index 5dd90298b..0f34c4f9e 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -345,8 +345,23 @@ static CURLcode smtp_state_mail_resp(struct connectdata *conn,
}
else {
/* send RCPT TO */
- result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:%s",
- data->set.str[STRING_MAIL_RCPT]);
+ struct curl_slist *rcpt;
+ char *buffer = NULL;
+
+ for(rcpt = data->set.mail_rcpt; rcpt; rcpt=rcpt->next) {
+ char *add = aprintf("%s%s%s", buffer?buffer:"", buffer?", ":"",
+ rcpt->data);
+ if(!add) {
+ free(buffer);
+ return CURLE_OUT_OF_MEMORY;
+ }
+ buffer = add;
+ }
+
+ result = Curl_pp_sendf(&conn->proto.smtpc.pp, "RCPT TO:%s", buffer);
+
+ free(buffer);
+
if(result)
return result;
diff --git a/lib/url.c b/lib/url.c
index 05055acba..3f2f1cd72 100644
--- a/lib/url.c
+++ b/lib/url.c
@@ -2314,8 +2314,8 @@ CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,
break;
case CURLOPT_MAIL_RCPT:
- result = setstropt(&data->set.str[STRING_MAIL_RCPT],
- va_arg(param, char *));
+ /* get a list of mail recipients */
+ data->set.mail_rcpt = va_arg(param, struct curl_slist *);
break;
default:
diff --git a/lib/urldata.h b/lib/urldata.h
index 6c852e8ad..4bcb5bf6f 100644
--- a/lib/urldata.h
+++ b/lib/urldata.h
@@ -1166,7 +1166,6 @@ enum dupstring {
STRING_SOCKS5_GSSAPI_SERVICE, /* GSSAPI service name */
#endif
STRING_MAIL_FROM,
- STRING_MAIL_RCPT,
/* -- end of strings -- */
STRING_LAST /* not used, just an end-of-list marker */
@@ -1337,6 +1336,7 @@ struct UserDefined {
#if defined(HAVE_GSSAPI) || defined(USE_WINDOWS_SSPI)
long socks5_gssapi_nec; /* flag to support nec socks5 server */
#endif
+ struct curl_slist *mail_rcpt; /* linked list of mail recipients */
};
struct Names {