I am creating a small email client that logs into Gmail via the Imap protocol and searches for a specific email sender the downloads the contents of that particular message.
I am using C++ and libcurl.
I have managed to login, and the response returned after the headers is the first email in my inbox.
I would like to know how to send requests/commands via the Imap protocol that can be configured to work with Libcurl. A brief reading of the RFC spec suggests the form of
<COMMAND> <argument>
and whilst this might work on the command line with telnet or curl, it is not compatible with C/C++.
I am logging in via a URL string (char * to be exact) of the form
"imaps://" <username> ":" <password> "@imap.gmail.com:993"
and passing this as the url for curl to initiate, but I am having trouble forming any other request of the same form.
What is the correct way to send commands to gmail/imap using Libcurl?
Thanks in advance
Any help is much appreciated…
I’d say a rough syntax description would look similar to