From 5a9d7c4e68fccd4f67c95cea76a1c3467fbe71d2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 29 Mar 2022 14:01:48 +0200 Subject: pop3/smtp: return *WEIRD_SERVER_REPLY when not understood This leaves the CURLE_RECV_ERROR error code for explicit failure to receive network data and allows users to better separate the problems. Ref #8356 Reported-by: Rianov Viacheslav Closes #8506 --- lib/smtp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/smtp.c') diff --git a/lib/smtp.c b/lib/smtp.c index 28aa44a49..3e04154ba 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -1037,7 +1037,7 @@ static CURLcode smtp_state_command_resp(struct Curl_easy *data, int smtpcode, if((smtp->rcpt && smtpcode/100 != 2 && smtpcode != 553 && smtpcode != 1) || (!smtp->rcpt && smtpcode/100 != 2 && smtpcode != 1)) { failf(data, "Command failed: %d", smtpcode); - result = CURLE_RECV_ERROR; + result = CURLE_WEIRD_SERVER_REPLY; } else { /* Temporarily add the LF character back and send as body to the client */ @@ -1182,7 +1182,7 @@ static CURLcode smtp_state_postdata_resp(struct Curl_easy *data, (void)instate; /* no use for this yet */ if(smtpcode != 250) - result = CURLE_RECV_ERROR; + result = CURLE_WEIRD_SERVER_REPLY; /* End of DONE phase */ state(data, SMTP_STOP); -- cgit v1.2.1