]> granicus.if.org Git - curl/commitdiff
smtp: Fixed an issue when processing EHLO failure responses (Part 3)
authorSteve Holme <steve_holme@hotmail.com>
Sat, 9 Feb 2013 19:01:15 +0000 (19:01 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Sat, 9 Feb 2013 19:01:15 +0000 (19:01 +0000)
Follow up fix to commit 62bd21746443 to cater for servers that don't
respond with a 250 in their EHLO responses. Additionally updated the
SMTP tests to respond with a 250 response code as per RFC5321.

lib/smtp.c
tests/data/test805
tests/data/test806
tests/data/test807

index fd8d71226270025fde26cdf23052aeb54d006015..dd08575beb3adc5a67721d944006e024e49a4fd4 100644 (file)
@@ -224,7 +224,7 @@ static int smtp_endofresp(struct pingpong *pp, int *resp)
     *resp = curlx_sltosi(strtol(line, NULL, 10));
 
   /* Are we processing EHLO command data? */
-  if(smtpc->state == SMTP_EHLO && (!result || (result && *resp == 250))) {
+  if(smtpc->state == SMTP_EHLO && (!result || (result && *resp/100 == 2))) {
     line += 4;
     len -= 4;
 
index 4595221c9e0943cfc1a2bcfac376dfdf3b5cf9a9..d124e40e71e0a465bf326bd69c208ab1aaa2d212 100644 (file)
@@ -12,7 +12,7 @@ RFC4954
 # Server-side
 <reply>
 <servercmd>
-REPLY EHLO 220 AUTH PLAIN
+REPLY EHLO 250 AUTH PLAIN
 REPLY AUTH 235 Authenticated
 </servercmd>
 </reply>
index b71ac5cceef77a44dcfcbd2ce0f536086867abed..9d1c9881496523698dc07272cf21ab38d994d435 100644 (file)
@@ -11,7 +11,7 @@ RFC4954
 # Server-side
 <reply>
 <servercmd>
-REPLY EHLO 220 AUTH LOGIN
+REPLY EHLO 250 AUTH LOGIN
 REPLY AUTH 334 UGFzc3dvcmQ6
 REPLY MTIzNA== 235 Authenticated
 </servercmd>
index d171ffabc78cc20c5069644ea343a5cbb0d010e4..4165a1553e0612591fdc2add75f6df95668e1e3e 100644 (file)
@@ -12,7 +12,7 @@ RFC4954
 # Server-side
 <reply>
 <servercmd>
-REPLY EHLO 220 AUTH CRAM-MD5
+REPLY EHLO 250 AUTH CRAM-MD5
 REPLY AUTH 334 PDE4OTYuNjk3MTcwOTUyQHBvc3RvZmZpY2UucmVzdG9uLm1jaS5uZXQ+
 REPLY dGltIGI5MTNhNjAyYzdlZGE3YTQ5NWI0ZTZlNzMzNGQzODkw 235 Authenticated
 </servercmd>