You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When retrieving message contents via CURLOPT_CUSTOM_REQUEST, a message with a line beginning with '+ ' can cause the request to fail with the error "FTP: weird server reply".
Running in verbose, curl prints out "Unexpected continuation response", which is can be found in imap_endofresp.
This appears to be due to custom commands being treated as LIST instead of FETCH in this instance, so curl continues to do extra processing on the body.
Message to reproduce:
To: <test@example.org>
From: <test@example.org>(Example User)
Subject: IMAP Bogus message
+ This line breaks IMAP custom command processing.
Code to reproduce:
#include<stdio.h>
#include<stdlib.h>
#include<curl/curl.h>
#defineUSERNAME"username"
#definePASSWORD"password"
#defineSERVER_URL"imap://mail.example.org/"// This is the UID of the message that contains a line beginning with "+ "
#defineBAD_MESSAGE_UID"2358"
#defineFETCH_COMMAND"UID FETCH " BAD_MESSAGE_UID " (UID BODY.PEEK[1])"intmain(void) {
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if( curl ) {
curl_easy_setopt(curl, CURLOPT_USERNAME, USERNAME);
curl_easy_setopt(curl, CURLOPT_PASSWORD, PASSWORD);
curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
curl_easy_setopt(curl, CURLOPT_URL, SERVER_URL "INBOX");
// Do the requestcurl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, FETCH_COMMAND);
res = curl_easy_perform(curl);
if( res != CURLE_OK ) {
fprintf(stderr, "curl_easy_perform() failed: %s\n", curl_easy_strerror(res));
}
curl_easy_cleanup(curl);
}
return res;
}
When retrieving message contents via CURLOPT_CUSTOM_REQUEST, a message with a line beginning with '+ ' can cause the request to fail with the error "FTP: weird server reply".
Running in verbose, curl prints out "Unexpected continuation response", which is can be found in imap_endofresp.
This appears to be due to custom commands being treated as LIST instead of FETCH in this instance, so curl continues to do extra processing on the body.
Message to reproduce:
Code to reproduce:
Relevant output:
The text was updated successfully, but these errors were encountered: