In response to point # 1, according to Max , you can use body.peak to avoid this.
In response to point # 2, according to triplee , you can connect to all accounts and then use the IMAP extension called IDLE .
In response to item # 3, I found the Outlook REST API , which includes options for reading email, and you can call GET https://outlook.office.com/api/beta/me/messages on a regular basis to get all messages in the user account, or you can call GET https://outlook.office.com/api/v1.0/me/messages on a regular basis to receive all messages in the user's mailbox. You can find a complete list of REST API operations here .
In response to paragraph 4, I believe that some of your problems are problems, while others are not. I believe that you have no technical problems. However, I believe that you are correct that IMAP is not intended for applications like yours, as shown in the Wikipedia article on IMAP , which states: mine),
In computing, the Internet Message Access Protocol (IMAP) is the standard Internet protocol used by email clients to receive email messages from the mail server over a TCP / IP connection. IMAP is defined by RFC 3501.
In addition, in RFC 3501 , which defines the original IMAP protocol, it refers to mail clients that are read from a paragraph (mine is bold)
Internet Message Access Protocol version 4rev1 (IMAP4rev1) allows the client to receive and process electronic messages on the server.
Benjamin
source share