'In MailKit How do I get the UniqueId for a message deleted from the OnMessageExpunged Event
Using Mailkit and monitoring the Inbox
I have the callback OnMessageExpunged registered on the Inbox so I can track messages deleted from the Inbox by external influences.
Inbox.MessageExpunged += OnMessageExpunged;
...
void OnMessageExpunged( object? sender, MessageEventArgs e )
{
...
}
When the event is fired, the MessageEventArgs has a field Uniqueid but it is null. It only has the message index. I am tracking all the emails based on UniqueId because all the indexes change when a message is deleted hence I am sorta stuffed unless I rescan the entire Inbox on message deleted and look for any missing UniqueIds. Am I missing something?
Solution 1:[1]
You need to keep consistent state with IMAP so that you can correctly map indexes to UIDs in your local cache.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | jstedfast |
