Repeatedly retrieving message UID #471
-
Hello, I'm developing a mail client which monitors new messages. The monitoring part is done on a thread with IDLE support and a queue. For every new message, I get an IDLE response with an EXISTS tag and message sequence number, e.g. Let say I receive about 100 new messages in a burst. My client will be repeatedly retrieving the UID via PS: It is important for me to use message UID due to its persistency across clients.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Unfortunately, the In my experience it's best to just use any IDLE response as a signal that something changed and then use some other mechanism to figure out what changed. There is too much variation between servers to bother with interpreting specific IDLE responses. I would suggest that given that UIDs always increase and should persist between sessions, you should track the highest previously seen UID in the folder and then use something like To really to do this right, please also read about |
Beta Was this translation helpful? Give feedback.
Unfortunately, the
EXISTS
response isn't giving you a message sequence number, just the number of messages in the folder so you can't use the number sent withEXISTS
the way you are.In my experience it's best to just use any IDLE response as a signal that something changed and then use some other mechanism to figure out what changed. There is too much variation between servers to bother with interpreting specific IDLE responses.
I would suggest that given that UIDs always increase and should persist between sessions, you should track the highest previously seen UID in the folder and then use something like
SEARCH UID 99:*
(where 99 is the last seen highest UID for the folder) when an IDL…