aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2012-01-07 13:42:28 +0000
committerDaniel Stenberg <daniel@haxx.se>2012-02-15 21:51:45 +0100
commitb685481d527309d595ebf3551048a9f96975dc9e (patch)
treecbf9c2e3cda24a10d61937df4c125469ca643c77
parent0cf0ab6f3008aaad0bb5e3291539e80123028864 (diff)
smtp.c: Fixed use of angled brackets in AUTH parameter.
Fixed the use of angled brackets "<>" in the optional AUTH parameter as per RFC-2554 section 5. The address should not include them but an empty address should be replaced by them.
-rw-r--r--lib/smtp.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index c02c9bdd4..fa5452aff 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -912,10 +912,11 @@ static CURLcode smtp_mail(struct connectdata *conn)
/* calculate the optional AUTH parameter */
if(data->set.str[STRING_MAIL_AUTH] && conn->proto.smtpc.authused) {
- if(data->set.str[STRING_MAIL_AUTH][0] == '<')
+ if(data->set.str[STRING_MAIL_AUTH][0] != '\0')
auth = aprintf("%s", data->set.str[STRING_MAIL_AUTH]);
else
- auth = aprintf("<%s>", data->set.str[STRING_MAIL_AUTH]);
+ /* empty AUTH, RFC-2554, sect. 5 */
+ auth = strdup("<>");
if(!auth) {
Curl_safefree(from);