有可能吗?我了解自定义请求;所以我发送带有文本“DELE”的自定义请求,并设置我想要删除的消息ID。结果,curl_easy_perform挂起,直到出现超时。在网络论坛上,人们撰写建议,在“DELE”之后发送“QUIT”命令;但是如果libcurl挂起,我怎么能发送“QUIT”命令呢?如何用libcurl和POP3删除电子邮件?
libcurl的调试输出如下:
* Connected to pop-mail.outlook.com (157.55.1.215) port 995 (#2)
* SSL connection using DES-CBC3-SHA
* Server certificate:
* subject: C=US; ST=Washington; L=Redmond; O=Microsoft Corporation; CN=*.
hotmail.com
* start date: 2013-04-24 20:35:09 GMT
* expire date: 2016-04-24 20:35:09 GMT
* issuer: C=BE; O=GlobalSign nv-sa; CN=GlobalSign Organization Validation
CA - G2
* SSL certificate verify result: unable to get local issuer certificate (
20), continuing anyway.
< +OK DUB0-POP132 POP3 server ready
> CAPA
< -ERR unrecognized command
> USER ************@hotmail.com
< +OK password required
> PASS ******************
< +OK mailbox has 1 messages
> DELE 1
< +OK message deleted
* Operation too slow. Less than 1000 bytes/sec transferred the last 10 seconds
> QUIT
* Operation too slow. Less than 1000 bytes/sec transferred the last 10 seconds
* Closing connection 2
因此,该消息被删除,但libcurl中挂起,直到限速强制它断开,这是坏主意。如何强制它在删除消息后停止并且不要等到超时到来?
该示例缺少'CURLOPT_NOBODY',它指出了对于POP3'DELE'请求需要使用的文件。 –
啊哈,我会让史蒂夫知道(谁写的例子)谢谢! –
该示例现在已更新并使用CURLOPT_NOBODY –