curl / Mailing Lists / curl-library / Single Mail
Buy commercial curl support from WolfSSL. We help you work out your issues, debug your libcurl applications, use the API, port to new platforms, add new features and more. With a team lead by the curl founder himself.

AW: POP3: UIDL for message

From: Patrick Schlangen via curl-library <curl-library_at_lists.haxx.se>
Date: Tue, 30 May 2023 19:41:38 +0000

Hi,

I’d guess curl tries to retrieve the body (until it sees a terminating dot) and, since UIDL with arg doesn’t have a body, it will wait indefinitely.
Did you try with CURLOPT_NOBODY set to 1?

Best,

Patrick

Von: curl-library <curl-library-bounces_at_lists.haxx.se> Im Auftrag von ?????? - via curl-library
Gesendet: Dienstag, 30. Mai 2023 09:31
An: curl-library_at_lists.haxx.se
Cc: Сергей - <tatarintsev.sv_at_gmail.com>
Betreff: POP3: UIDL for message


I'm trying to get a UIDL via POP3 for a specific message, but libcurl freezes. Receiving UIDL for all messages works fine.

My simple example:

    CURL *curl;

    CURLcode res = CURLE_OK;

    curl = curl_easy_init();

    char* cmd1="UIDL";

    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

    curl_easy_setopt(curl, CURLOPT_USERNAME, user);

    curl_easy_setopt(curl, CURLOPT_PASSWORD, password);

    curl_easy_setopt(curl, CURLOPT_URL, host);

    curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, curl_response_headers);

    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_read);

    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, cmd1);

    res = curl_easy_perform(curl);
/* Here we successfully receive some headers+data like this
1 000002885ffbcd35

2 000002895ffbcd35

3 0000028a5ffbcd35
*/

    // but if i want to get uidl for specific message:

    char* cmd2="UIDL 1";

    curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);

    curl_easy_setopt(curl, CURLOPT_USERNAME, user);

    curl_easy_setopt(curl, CURLOPT_PASSWORD, password);

    curl_easy_setopt(curl, CURLOPT_URL, host);

    curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, curl_response_headers);

    curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, curl_read);

    curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, cmd2);

    res = curl_easy_perform(curl);
/*i receive headers with (that's actually expected)
+OK 1 000002885ffbcd35#015
and curl_easy_perform() freezes until timeout reached
*/

How i can correctly receive uidl for message

-- 
Unsubscribe: https://lists.haxx.se/mailman/listinfo/curl-library
Etiquette:   https://curl.se/mail/etiquette.html
Received on 2023-05-30