Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libcurl POP3 expects "CRLF.CRLF" eob for single-line response from certain commands. #740

nemaakhilesh opened this issue Mar 30, 2016 · 2 comments


Copy link

I did this

I have a situation where I need to get UIDL for specific message number in POP3 mailbox. Used following

curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "UIDL 1"))

But it does't work. libcurl gets stuck waiting for data until timeout. (It only works with CURLOPT_NOBODY set to 0).

POP3 expects "\x0d\x0a\x2e\x0d\x0a" (CRLF.CRLF) even for single-line response for certain commands. I have seen this with following commands UIDL msg, STAT, RSET, NOOP etc.


Is there any workaround to store response data from custom POP3 requests, which return single line response with EOB as "CRLF"?

(I don't want to use "UIDL" that returns list of msg, UIDL pair and parse it to get specific UIDL)

I expected the following

When performing "UIDL msg", curl_easy_perform should return immediately after receiving + OK < msg > < UIDL > CRLF

curl/libcurl version

curl 7.45.0
curl 7.45.0 (x86_64-pc-linux-gnu) libcurl/7.45.0 OpenSSL/1.0.1f zlib/1.2.8 libidn/1.28 libssh2/1.4.4_DEV librtmp/2.3
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtmp rtsp scp sftp smb smbs smtp smtps telnet tftp
Features: IDN IPv6 Largefile NTLM NTLM_WB SSL libz TLS-SRP UnixSockets

operating system

Ubuntu 14.04.3 LTS

@nemaakhilesh nemaakhilesh changed the title pop3 expects response ending with CRLF.CRLF for single-line response from certain commands. POP3 expects "CRLF.CRLF" eob for single-line response from certain commands. Mar 30, 2016
@nemaakhilesh nemaakhilesh changed the title POP3 expects "CRLF.CRLF" eob for single-line response from certain commands. libcurl POP3 expects "CRLF.CRLF" eob for single-line response from certain commands. Mar 30, 2016
Copy link

This is currently intended behaviour, in that you have to tell libcurl not to expect a body, when dealing with one line response commands. Please see the POP3 examples and test cases which show this for the NOOP and DELE commands.

However, we are open to code modifications which negate the need to do this without breaking API compatibility if you fancy a challenge ;-)

Copy link

bagder commented Apr 1, 2016

Is there any way we can document this better to make it less surprising?

@bagder bagder added the POP3 label Apr 1, 2016
@captain-caveman2k captain-caveman2k self-assigned this Apr 3, 2016
@bagder bagder closed this as completed in a69f27a Jun 28, 2016
@lock lock bot locked as resolved and limited conversation to collaborators May 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

No branches or pull requests

3 participants