cURL / Mailing Lists / curl-library / Single Mail

curl-library

POP3 DELE not deleting

From: brett kaylor <bbkaylor_at_yahoo.com>
Date: Fri, 5 Apr 2013 07:03:20 -0700 (PDT)

I am using curl-7.29.0 on Windows.  I can connect, list, and retrieve POP3 emails, but cannot seem to delete them.  The return value indicates success, but the message is still there.  My code snip below     CURL mCurl = curl_easy_init();    std::string id = "1"; // test case, and id 1 is valid.    if (mCurl)    {       curl_easy_setopt(mCurl, CURLOPT_WRITEDATA, (void*)this);        curl_easy_setopt(mCurl, CURLOPT_TIMEOUT, 10); // seconds for entire operation       curl_easy_setopt(mCurl, CURLOPT_CONNECTTIMEOUT, 10); // seconds for connection timeout        curl_easy_setopt(mCurl, CURLOPT_USERPWD, popPassword->GetStringValue().c_str());       curl_easy_setopt(mCurl, CURLOPT_URL, popHost->GetStringValue().c_str());       curl_easy_setopt(mCurl, CURLOPT_VERBOSE, 1L);       std::string url = popHost->GetStringValue() + id;       curl_easy_setopt(mCurl, CURLOPT_URL, url.c_str());       curl_easy_setopt(mCurl, CURLOPT_NOBODY, 1);        curl_easy_setopt(mCurl, CURLOPT_CUSTOMREQUEST, "DELE");       CURLcode res3 = curl_easy_perform(mCurl);       if (res3 == 0)       {           std::cout << "Successfully delete message " << id << std::endl;        }    } Produces these resutls: * Found bundle for host mail.XXXXcom: 0x71ddb0 * Re-using existing connection! (#0) with host mail.XXXX.com * Connected to mail.XXXX.com (XX.XX.XX.XX) port 110 (#0) > RETR 1 < +OK 12636 octets * Connection #0 to host mail.XXXX.com left intact * Found bundle for host mail.XXXX.com: 0x71ddb0 * Re-using existing connection! (#0) with host mail.XXXX.com * Connected to mail.scumfish.com (XX.XX.XX.XX) port 110 (#0) > DELE 1 < +OK Message 1 deleted * Connection #0 to host mail.scumfish.com left intact Successfully delete message 1

-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2013-04-05