IMAP getting UID List of selected folder
Asked Answered
L

1

7

How can I retrieve the list of IMAP UIDs from the selected folder? I want to get the list of mail UIDs, so I am passing the 1150 UID FETCH FLAGS (\Seen \Flagged), but I am not able to retrieve the list: it gives me an error like BAD Command. So how I can retrieve the list of UID from the selected folder?

Lilienthal answered 16/2, 2011 at 10:27 Comment(0)
A
13

The easiest (and most compact) way to list all the UIDs in the currently-selected folder is via UID SEARCH ALL:

A001 UID SEARCH ALL
* SEARCH 288 291 292 293 295 323 324 325 326 327 385 387 472 474 641 720 748
A001 OK UID SEARCH completed

The errors in your UID FETCH request were leaving out the sequence-set and including a list of flags. If you rewrote it as

A002 UID FETCH 1:* (UID)

or

A002 UID FETCH 1:* (UID FLAGS)

it would work.

Aldehyde answered 17/2, 2011 at 13:34 Comment(1)
UID SEARCH result not getting flags can you please help me to get the flag result in SearchAultman

© 2022 - 2024 — McMap. All rights reserved.