cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Enhancing POP3 to support extra commands

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 6 Dec 2011 00:02:12 +0100 (CET)

On Fri, 2 Dec 2011, Steve Holme wrote:

> As such I have a query as I'm a little confused from reading curl's --help
> as well as looking at the code:
>
> -Q, --quote CMD Send command(s) to server before transfer (F/SFTP)
> -X, --request COMMAND Specify request command to use
>
> -X uses the CURLOPT_CUSTOMREQUEST option, which will be pretty easy for me
> to pick up in pop3.c. However, I am lost at -Q and whether I would use
> CURLPT_QUOTE, CURLOPT_PREQUOTE or CURLOPT_POSTQUOTE.

-X is used to modify what libcurl would otherwise use.

-Q is used to provide a list of commands to execute at some point, and the
three different QUOTE lists run at different times - like before and after the
"actual" file transfer.

Remember that neither -X nor -Q prevents the actual "main" transfer, -X just
changes it and -Q adds instructions.

> Should I be using one or both of these options? My thoughts are to use just
> the -X argument so for example curl command lines might be as follows:
>
> --url pop3://mail.domain.com - List all messages
> --url pop3://mail.domain.com -X LIST - List all messages

Right, or more likely you'd use -X to do something else than LIST with that
URL as LIST would be the default for that URL. Right?

I would imagine you'd use -Q to do a full series of commands at once while
connected. Like issuing a series of deletes or so.

> I have listed all the possible commands above using their POP3 syntax - We
> could use full English words such as RETRIEVE, DELETE, RESET etc... ??

No, I think we should pass on exactly what the user specifies as that's what
-X and -Q do for other protocols (well, except for SFTP but SFTP has a binary
protocol so we use the documented names and convert them to binary).

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2011-12-06