IMAP folder / message synchronization strategy?

I am going to add IMAP email integration to one of our web applications (ASP.NET/SQL Server). I already use a commercial library that provides the most important IMAP functions: get a list of folders, get message headers, get a mime message, etc.),

Retrieving Live email data from an IMAP server works very well. But here is the difficult task: I need to synchronize the caching of the email database / folders with the IMAP server (I have to show data with different criteria).

Our database schema essentially contains the โ€œFoldersโ€ and โ€œEmailโ€ tables. The "Emails" table mainly contains a header, such as "FromAddress", "FromName", "IsRead", "IsAnswered", "IsForwarded", "HasAttachments", etc. ( no email content or attachments).

I need to consider two main scenarios:

  • Receiving all messages for the first time (or after re-organizing user folders)
  • Receive new / recent messages

What would be a good synchronization strategy for updating the mail server and the database server, given that performance is the main development criterion (I cannot just query or compare thousands of messages every time I connect, in order to find out if the user moved or deleted some old emails).

Thanks!

+3
source share
1 answer

From the list of functions of your library:

Improved support for UniqueId: we have added even more options to request a unique message identifier. You can now return UniqueId in the DataTable message for return trips to the IMAP server.

and

  • Receive only new messages
  • Search for tagged posts
  • /

, SQL-. , . .

, . "", IMAP, SQL Server "" IMAP .

, . . , "" , (/ ) . "" , . , , .

/ "", , , . , , . " " " " , , .

+2

Source: https://habr.com/ru/post/1704078/


All Articles