Issue
We can get the subject of mail 325 with this commmand
curl.exe -u user:pass imaps://imap.test.com/inbox;mailindex=325;section=header.fields%20(subject)
What if I want to get subjects of mail 325 and 326?
I tried this, no luck
curl.exe -u user:pass imaps://imap.test.com/inbox;mailindex=325,326;section=header.fields%20(subject)
Although, with -v I can see the subject of mail 326, but that's not I want
curl.exe -v -u user:pass imaps://imap.test.com/inbox;mailindex=325,326;section=header.fields%20(subject)
Of course with this command you can see subjects of 325 and 326, But this is not I want neither.
curl.exe -u user:pass imaps://imap.test.com/inbox;mailindex=321;section=header.fields%20(subject) imaps://imap.test.com/inbox;mailindex=322;sectio
n=header.fields%20(subject)
Solution
It seems that you were pretty close, several syntaxes are documented for this purpose:
curl.exe -u user:pass imaps://imap.test.com/inbox;mailindex={325,326};section=header.fields%20(subject)
^ ^ ^
In this example, mailindex will be set to 325, the request will be processed, then mailindex will be sent to 326 and the request will be processed. The results will be sent in the same order. The values you can put between the brackets are not necessarily numbers, it could be strings also.
A slightly different syntax is available to identify numerical ranges:
curl.exe -u user:pass imaps://imap.test.com/inbox;mailindex=[325-326];section=header.fields%20(subject)
^ ^ ^
Here, mailindex will start with 325 and finish with 326 with a implicit increment of +1 at each step. One could also want to increment with another value:
curl.exe -u user:pass imaps://imap.test.com/inbox;mailindex=[326-330:2];section=header.fields%20(subject)
^^
In this final example, the iteration will start with mailindex=326, then mailindex=328 and finally mailindex=330.
Answered By - Robert Answer Checked By - Mildred Charles (WPSolving Admin)