+2 votes

For each folder, largestUID is different right?
for e.g Inbox 557, Draft 402, Folder-1 301

So do we need to save folder wise largestUID ? As in below link

https://www.limilabs.com/blog/get-new-emails-using-imap

internal class LastRun
{
    public long UIDValidtiy { get; set; }
    public long LargestUID { get; set; }
}

mentioned about the above object and in this object, there is no folder name added so I want to know how we can manage folder wise?

by

1 Answer

0 votes

In most cases new emails arrive to INBOX only, the sample you are referring to is checking this folder only.

If you need to check other folders you need to save: folder name, folder's UIDValidtiy and Largest UID for all folders you want to monitor.

Please note that server may use same UIDs in different folders

You can find more detail on UIDs here:
https://www.limilabs.com/blog/unique-id-in-imap-protocol

by (269k points)
I Understood, Thanks.

In below url there are two variable.
https://www.limilabs.com/blog/unique-id-in-imap-protocol

LastRun last and long largestUID. what is the difference between both? can't we use last.LargestUID instead of largestUID?
There was a minor typo in the 2nd set of examples - use last.LargestUID.
...