Hello,
 
> On Fri, 15 Mar 2019, Daniel Stenberg via curl-library wrote:
> 
> This is hardly an approach that we can use in curl so while this might fix
Luca's
> current problem, it is not a patch we can merge as-is.
> I would be interested in discussing what we should or could do to support
this
> feature in a more proper and curl-friendly way.

I definitely agree, and I have changed the implementation to be in line with
current imap.c structure of the code.

I have added a new function (imap_perform_custom_fetch_body) that behaves
similarly to existing  imap_perform_fetch, with the difference that it sends
the custom specified FETCH BODY command instead of building a FETCH command
with the data form the imap URL.

In the imap_state_select_resp function, where commands (e.g. search, fetch,
custom commands, etc...) are executed on receiving an OK response of a
"select" mailbox,  I have added a check to verify if the custom command to
be executed is a fetch of a message body. If so,  the new function
imap_perform_custom_fetch_body is invoked, otherwise the flow continues as
before by invoking the imap_perform_list function.

To me this seems ok now, but of course it's better to have it checked by
experts.

Thanks and BR,
Luca

Attachment: 0001-Added-fetch-of-a-message-body-via-custom-command-X-o.patch
Description: Binary data

-------------------------------------------------------------------
Unsubscribe: https://cool.haxx.se/list/listinfo/curl-library
Etiquette:   https://curl.haxx.se/mail/etiquette.html

Reply via email to