You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* This will create a new message 100. Note that you should perform an
* EXAMINE command to obtain the UID of the next message to create and a
* SELECT to ensure you are creating the message in the OUTBOX. */
curl_easy_setopt(curl, CURLOPT_URL, "imap://imap.example.com/100");
But it is wrong:
you don't need to pass the message UID to do an APPEND, but you need to pass the folder name, so the URL should be imap://imap.example.com/Sent. In fact there is no UID used in the imap_perform_append function
Curl is already doing a SELECT in its append function, so there is no need to do a SELECT
This can lead to some confusion when the example is wrong :)
Activity
jay commentedon Jan 16, 2023
Is this true of IMAP protocol or just the server you are using?
/cc @captain-caveman2k
bagder commentedon Feb 9, 2023
No response, closing.
bohwaz commentedon Feb 9, 2023
You didn't give me enough time to reply @bagder :)
@jay This is not related to the IMAP protocol, this is what the curl code is doing. Curl IMAP code for APPEND is never using the UID: https://github.com/curl/curl/blob/master/lib/imap.c#L763-L826
Everything is in my original message :)
bagder commentedon May 16, 2023
okay @bohwaz so can you please tell us what you think the fix is? Perhaps with a PR for the example?
bohwaz commentedon May 16, 2023
Hi @badger yes :)
The mentioned lines should be replace by this:
imap-append.c: update to make it more likely to work
imap-append.c: update to make it more likely to work
imap-append.c: update to make it more likely to work