question

Azy1412-2549 avatar image
0 Votes"
Azy1412-2549 asked Azy1412-2549 commented

Exchange 2016: IMAP4 not working (user and mailbox are in a different site)

IMAP4 on Exchange server not working. When we telnet to port:993 we get a black screen (screenshot)78286-telnet-blackscreen.png



the test the IMAP settings output:

[PS] C:\Windows\system32>Test-ImapConnectivity -ClientAccessServer EX01 -MailboxCredential (Get-Credential domain\user) |fl Port,connectionType,Result,Error


Port : 0
ConnectionType : Plaintext
Result : Failure
Error : Unable to create MailboxSession object to access the mailbox [email address].

              Detailed error information:
              [Microsoft.Exchange.Data.Storage.WrongServerException]: The user and the mailbox are in different
              Active Directory sites. Inner error [Microsoft.Mapi.MapiExceptionMailboxInTransit]:
              MapiExceptionMailboxInTransit: Detected site violation (hr=0x0, ec=1292)


We've modified the IMAP4 config file: Microsoft.Exchange.Imap4.exe.config
to allow cross site authentication, the restarted the service but it didn't resolve the issue.

IMAP4 component shows health
[PS] C:\Windows\system32>Get-ServerHealth EX01 | ?{$_.HealthSetName -like "IMAP*"}


Server State Name TargetResource HealthSetName AlertValue ServerComp
onent


EX01 NotApplicable ImapCTPMonitor MSExchangeImap4 IMAP Healthy None
EX01 NotApplicable ProcessProcessorT... microsoft.exchang... IMAP.Protocol Healthy None
EX01 NotApplicable ImapSelfTestMonitor MSExchangeImap4BE IMAP.Protocol Healthy None
EX01 NotApplicable ImapDeepTestMonitor MSExchangeImap4BE IMAP.Protocol Healthy None
EX01 NotApplicable PrivateWorkingSet... microsoft.exchang... IMAP.Protocol Healthy None
EX01 NotApplicable ProcessProcessorT... microsoft.exchang... IMAP.Protocol Healthy None
EX01 NotApplicable CrashEvent.M.exch... microsoft.exchang... IMAP.Protocol Healthy None
EX01 NotApplicable PrivateWorkingSet... microsoft.exchang... IMAP.Protocol Healthy None
EX01 NotApplicable ProcessProcessorT... microsoft.exchang... IMAP.Protocol Healthy None
EX01 NotApplicable ProcessProcessorT... microsoft.exchang... IMAP.Protocol Healthy None
EX01 NotApplicable CrashEvent.M.exch... microsoft.exchang... IMAP.Protocol Healthy None
EX01 Online ImapProxyTestMonitor MSExchangeImap4 IMAP.Proxy Healthy ImapProxy
EX01 NotApplicable PrivateWorkingSet... microsoft.exchang... IMAP.Protocol Healthy None
EX01 NotApplicable PrivateWorkingSet... microsoft.exchang... IMAP.Protocol Healthy None



Event Logs show the following warning:


The Test-CasConnectivity cmdlet failed. Find the entry in TransientErrorCache. BaseUrl: . MbxServre: EX01.contoso.local. Error: Target: EX01.contoso.local|HQ

Error: Unable to create MailboxSession object to access the mailbox [email address].

Detailed error information:
[Microsoft.Exchange.Data.Storage.WrongServerException]: The user and the mailbox are in different Active Directory sites. Inner error [Microsoft.Mapi.MapiExceptionMailboxInTransit]: MapiExceptionMailboxInTransit: Detected site violation (hr=0x0, ec=1292)


Details:


Client Access Server Name: EX01.contoso.local
Scenario: Create a MailboxSession object.
Scenario Description: Creating MailboxSession object to access the mailbox [email address].
User Name: user
Performance Counter Name:
Result: Failure
Site: HQ
Latency: -00:00:00.0010000
Secure Access: True
ConnectionType: Plaintext
Port: 0
Latency (ms): -1
Virtual Directory Name:
URL: null
URL Type: Unknown
Error:
Unable to create MailboxSession object to access the mailbox [user].

Detailed error information:
[Microsoft.Exchange.Data.Storage.WrongServerException]: The user and the mailbox are in different Active Directory sites. Inner error [Microsoft.Mapi.MapiExceptionMailboxInTransit]: MapiExceptionMailboxInTransit: Detected site violation (hr=0x0, ec=1292)






. Warning: .


Thank you for your continuous support!

office-exchange-server-administrationoffice-exchange-server-mailflowoffice-exchange-server-connectivityoffice-exchange-server-itpro
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

EricYin-MSFT avatar image
0 Votes"
EricYin-MSFT answered Azy1412-2549 commented

Hi,
1 Check the IMAP services, make sure all IMAP services are running on all servers. We can also try to restart these services and check if any helps. (There are two services : Microsoft Exchange IMAP4 & Microsoft Exchange IMAP4 Backend )
2 Check the certificate, make sure it had been assigned to IMAP service. If you are using a 3rd party cert, you can try to switch to self-certificate as a test and check again.
3 Would you try specify the mailbox server that the test mailbox belongs to with "-MailboxServer name" ?
4 Run below command to turn on IMAP protocol logging to help resolve issue:
a. Enable logging: Set-ImapSettings -server <CAS server name> -ProtocolLoggingEnabled $true
b. Get the location of log file and mailbox server: Get-ImapSettings -server <CAS server name>
5 Do you have a LB?
You can have another test in EXRCA: https://testconnectivity.microsoft.com/tests/Imap/input


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


· 3
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@EricYin-MSFT
Hi,

1- Restarted both services IMAP4 and IMAP4 Backend (didn't resolve the issue)

2- Certificate has IMAP service assigned.

3- I've specified the server in the test-imapconnectivity: and it is showing successful now.


Now when I telnet to port 143 I get the welcome banner: The Microsoft Exchange IMAP4 service is ready.
but when I telnet 993 I still get a blank screen.

I am using an LB.

0 Votes 0 ·

Hi,
Can you bypass the LB when testing to ensure where the issue locates? (maybe by editing host file of client server?)
Check this blog and test if you have a same problem: http://jetzemellema.blogspot.com/2015/02/issue-with-and-fix-for-broken-imap-on.html
Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

0 Votes 0 ·

Hi @EricYin-MSFT

I ran the command: Get-HealthReport EX01 | where { $_.state -eq "Offline"}
the command didn't return anything.


I checked the IMAPProxy and it is running:
[PS] C:\Windows\system32>Get-ServerComponentState -Component IMAPProxy -Identity EX01

Server Component State


EX01.contoso.local IMAPProxy Active

0 Votes 0 ·