Our fellow customer and Office 365 user Bob Sledge kindly shared with the community his findings on which settings must be used in order to access Office 365 accounts via IMAP (and therefore with MailBee.NET), including shared mailboxes.
Server hostname: outlook.office365.com
Port: 993 (for encrypted IMAP)
Authentication: AuthenticationMethods.Auto or AuthenticationMethods.Regular
IMAP4 UserName: Email address of the Office 365 mailbox, e.g. firstname.lastname@example.org
IMAP4 Password: Domain password for the user assigned to that mailbox
Office 365 has the concept of a normal mailbox, and a “shared” mailbox. The above works for a normal mailbox. If you want to fetch mail from a “shared” mailbox, this is the trick to make it work.
You have to use the credentials of a user who has been assigned to a normal mailbox and has been delegated access to the shared mailbox. Let’s say the normal mailbox address is email@example.com. And let’s assume that the shared mailbox is SharedMailbox@mydomain.com. In order to fetch mail from this shared mailbox, you use these credentials (and firstname.lastname@example.org must have been delegated access to SharedMailbox@mydomain.com):
IMAP4 UserName: email@example.com\SharedMailbox
IMAP4 Password: Domain password for the user assigned to firstname.lastname@example.org