Access shared/delegate mailbox of Exchange Server
1. Enable IMAP and POP3 protocols
Make sure you have enabled IMAP and POP3. Following articles can help you with that:
2. Turn on basic authentication
Using Exchange Management Console
- Open EMC, expand to Server Configuration->Client Access.
- In the middle panel, click your exchange CAS server, click POP3 and IMAP4 tab, right click IMAP4 and choose properties.
- In Authentication tab, select “Plain text logon (Basic authentication)”, then click OK.
- Open services.msc, restart Microsoft Exchange Transport services.
Using Power Shell
Set-IMAPSettings -Server -LoginType PlainTextLogin
Set-POPSettings -Server -LoginType PlainTextLogin
Open services.msc, restart Microsoft Exchange Transport services.
3. Add permissions to the shared mailbox
Give one user full access permission to the shared mailbox:
Add-MailboxPermission Shared.Mailbox1 -user John.Doe -AccessRights FullAccess
This also can be configured from EMC (Exchange Management Console) gui, by selecting the mailbox and clicking on “Manage Full Access Permission…” at the right pane of the window.
Note: You can not add permissions for user without mailbox, Powershell is the only option in such case.
4. Access the shared mailbox
Exchange 2003
Use the following user format DomainName\Username\SharedMailboxAlias (note the use of SharedMailboxAlias it’s often same as the name but it may be different)
(e.g. DOMAIN\John.Doe\Shared.Mailbox1) to log into the shared mailbox.
Exchange 2007
Install this patch: http://support.microsoft.com/?kbid=949926
Use the following user format DomainName\Username\SharedMailboxAlias (note the use of SharedMailboxAlias it’s often same as the name but it may be different)
(e.g. DOMAIN\John.Doe\Shared.Mailbox1) to log into the shared mailbox.
Exchange 2010, Exchange 2013, Exchange 2016, Exchange 2019
Use the following user format DomainName\Username\SharedMailboxAlias (note the use of SharedMailboxAlias it’s often same as the name but it may be different)
(e.g. DOMAIN\John.Doe\Shared.Mailbox1) to log into the shared mailbox.
Office 365/Exchange Online
You can find more details here: https://www.limilabs.com/blog/shared-mailbox-office365
Use the following user format Username@DomainName\Shared@DomainName
You must use Login method:
client.Login(@"Username@DomainName\Shared@DomainName", "UserPassword");
-or- LoginPlain method:
client.LoginPlain("Shared@DomainName", "User@DomainName", UserPassword");
Don’t use UseBestLogin for Office365 shared mailboxes.
Using LoginPLAIN to login as a different user
You can try 3rd parameter of LoginPLAIN to log in as a different user:
using (Imap imap = new Imap)
{
imap.ConnectSSL("outlook.office365.com");
imap.LoginPLAIN("SharedMailboxAlias", "Username@DomainName", "UserPassword");
//...
imap.Close();
}