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

Closed
nemaakhilesh opened this Issue Mar 30, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@nemaakhilesh

nemaakhilesh commented Mar 30, 2016

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.

Question:

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
3.11.0-26-generic

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

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

@captain-caveman2k

This comment has been minimized.

Show comment
Hide comment
@captain-caveman2k

captain-caveman2k Mar 31, 2016

Member

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 ;-)

Member

captain-caveman2k commented Mar 31, 2016

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 ;-)

@bagder

This comment has been minimized.

Show comment
Hide comment
@bagder

bagder Apr 1, 2016

Member

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

Member

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 added the documentation label Apr 9, 2016

@bagder bagder closed this 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.