Let's walk through setup of Mozilla Thunderbird mail client to read mail from Office365 with 2-factor authentication. We will also setup the shared mailbox here.
Googling around and searching for a solution to setup mail client for use with Microsoft Office365 you can get quite a lot of manuals, for example this. However they works only with 1-factor authentication. There are two solutions how achieve the goal with 2-factor for which you have to use use OAuth2 method.
- Use an Owl plugin for older versions of Thunderbird (prior 78). It works quite good but costs the money.
- Use Thunderbird 78 and above.
So let's use the new version of Thunderbird, the account of a user in MS365 and a shared mailbox in MS365. Thunderbird settings are these then:
IMAP settings of user account
Server Type: IMAP mail server Server name: outlook.office36.com Port: 993 User Name: user@example.com Connection Security: SSL/TLS Authentication Method: OAuth2
SMTP settings of user account
Server name: smtp.office36.com Port: 587 Connection Security: STARTTLS Authentication Method: OAuth2 User Name: user@example.com
IMAP settings of shared mailbox
Server Type: IMAP mail server Server name: outlook.office36.com Port: 993 User Name: shared-mailbox@example.com Connection Security: SSL/TLS Authentication Method: OAuth2
When prompted for a password for shared-mailbox@example.com in OAuth2 dialog, click "Use a different user" and provide credentials for your user account. So it's not necessary to create any password for the shared mailbox or setup the authentication method in MS365.
For SMTP of the shared mailbox just use the already configured SMTP for user.