<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section
      name="MRSConfiguration"
      type="Microsoft.Exchange.MailboxReplicationService.MRSConfigSchema, Microsoft.Exchange.MailboxReplicationService.Common, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    />
    <section
      name="MrsProxyConfiguration"
      type="Microsoft.Exchange.MailboxReplicationService.MRSProxyConfiguration, Microsoft.Exchange.MailboxReplication.ProxyService, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    />
  </configSections>
  <runtime>
    <gcServer enabled="false" />
    <generatePublisherEvidence enabled="false"/>
  </runtime>
  <system.net>
    <connectionManagement>
      <add address="*" maxconnection="40"/>
    </connectionManagement>
    <defaultProxy>
      <proxy usesystemdefault="true" bypassonlocal="true" />
      <bypasslist>
        <add address=".*" />
      </bypasslist>
    </defaultProxy>
  </system.net>
  <system.serviceModel>
    <bindings>
      <wsHttpBinding>
        <binding 
          name="MrsCertBinding"
          maxReceivedMessageSize="100000000"
          receiveTimeout="00:00:50" 
          sendTimeout="00:20:00">
          <reliableSession 
            inactivityTimeout="00:22:00" 
            ordered="true" />
          <readerQuotas 
            maxArrayLength="35000000"
            maxBytesPerRead="4096"
            maxNameTableCharCount="16384"
            maxStringContentLength="35000000"
            maxDepth="256" />
          <security mode="TransportWithMessageCredential"> 
            <transport clientCredentialType="None" proxyCredentialType="None" realm=""/> 
            <message clientCredentialType="Certificate" algorithmSuite="Default" />      
          </security>
        </binding>
      </wsHttpBinding>
      <netTcpBinding>        
        <binding
          name="MrsBinding"
          portSharingEnabled="true"
          maxReceivedMessageSize="8388608" >
          <readerQuotas
            maxStringContentLength="262144" />
          <security mode="Transport">
            <transport
              clientCredentialType="Windows"
              protectionLevel="EncryptAndSign" />
          </security>
        </binding>
        
        <binding
          name="MrsProxyTcpBinding"
          maxConnections="1000"
          maxReceivedMessageSize="100000000"
          portSharingEnabled="true"
          receiveTimeout="00:20:00"
          sendTimeout="00:20:00"
          transactionFlow="false"
          transferMode="Buffered" >          
          <readerQuotas maxDepth="256"
                  maxStringContentLength="35000000"
                  maxArrayLength="35000000"
                  maxBytesPerRead="4096"
                  maxNameTableCharCount="16384" />          
          <security mode="Transport">
            <transport
              clientCredentialType="Windows"
              protectionLevel="EncryptAndSign" />
          </security>
        </binding>        
        <binding
          name="MrsProxyClientTcpBinding"
          maxReceivedMessageSize="100000000"
          receiveTimeout="00:20:00"
          sendTimeout="00:20:00"
          transactionFlow="false"
          transferMode="Buffered" >          
          <readerQuotas maxDepth="256"
                  maxStringContentLength="35000000"
                  maxArrayLength="35000000"
                  maxBytesPerRead="4096"
                  maxNameTableCharCount="16384" />          
          <security mode="Transport">
            <transport
              clientCredentialType="Windows"
              protectionLevel="EncryptAndSign" />
          </security>
        </binding>        
      </netTcpBinding>      
      <customBinding>
        <binding name="MrsProxyClientHttpsBinding"
                 receiveTimeout="00:00:50"
                 sendTimeout="00:20:00">
          <reliableSession
                 inactivityTimeout="00:22:00"
                 maxRetryCount="15"                 
                 ordered="true" />
          <textMessageEncoding>
            <readerQuotas 
                  maxArrayLength="35000000"
                  maxStringContentLength="35000000"
                  maxDepth="256" />
          </textMessageEncoding>
          <httpsTransport authenticationScheme="Negotiate"
                          maxReceivedMessageSize="100000000" />
        </binding>

        <binding name="MrsProxyHttpsBinding" 
            receiveTimeout="00:22:00">
          <reliableSession 
              inactivityTimeout="00:22:00" />
          <textMessageEncoding>
            <readerQuotas maxDepth="256"
                  maxStringContentLength="35000000"
                  maxArrayLength="35000000"
                  maxBytesPerRead="4096"
                  maxNameTableCharCount="16384" />          
          </textMessageEncoding>
          <httpsTransport authenticationScheme="Negotiate"
                  maxReceivedMessageSize="100000000" />
        </binding>
      </customBinding>
      <netNamedPipeBinding>
        <binding
          name="MrsBinding"
          maxReceivedMessageSize="8388608" >
          <readerQuotas
            maxStringContentLength="262144" />
          <security mode="Transport">
            <transport
              protectionLevel="EncryptAndSign" />
          </security>
        </binding>
      </netNamedPipeBinding>
    </bindings>
    <services>
      <service
        name="Microsoft.Exchange.MailboxReplicationService.MailboxReplicationService"
               behaviorConfiguration="MrsServiceBehavior">
        <endpoint address="net.tcp://localhost/Microsoft.Exchange.MailboxReplicationService"
                  binding="netTcpBinding"
                  bindingConfiguration="MrsBinding"
                  contract="Microsoft.Exchange.MailboxReplicationService.IMailboxReplicationService" />
        <endpoint address="net.pipe://localhost/Microsoft.Exchange.MailboxReplicationService"
                  binding="netNamedPipeBinding"
                  bindingConfiguration="MrsBinding"
                  contract="Microsoft.Exchange.MailboxReplicationService.IMailboxReplicationServiceSlim" />
      </service>
      <service
        name="Microsoft.Exchange.MailboxReplicationService.MailboxReplicationProxyService"
               behaviorConfiguration="MrsProxyServiceBehavior">
        <endpoint address="net.tcp://localhost/Microsoft.Exchange.MailboxReplicationService.ProxyService"
                  binding="netTcpBinding"
                  bindingConfiguration="MrsProxyTcpBinding"
                  contract="Microsoft.Exchange.MailboxReplicationService.IMailboxReplicationProxyService" />
        <endpoint address="https://localhost/Microsoft.Exchange.MailboxReplicationService.ProxyService"
                  binding="customBinding"
                  bindingConfiguration="MrsProxyHttpsBinding"
                  contract="Microsoft.Exchange.MailboxReplicationService.IMailboxReplicationProxyService" />
        <endpoint address="https://localhost/Microsoft.Exchange.MailboxReplicationService.ProxyService/Cert"
                  binding="wsHttpBinding"
                  bindingConfiguration="MrsCertBinding"
                  contract="Microsoft.Exchange.MailboxReplicationService.IMailboxReplicationProxyService" />
      </service>
    </services>
    <client>
      <!-- 
          MrsProxyClientHttpsEndpoint:    End point for E14 CAS or E15 CAFE connections.
          MrsProxyClientTcpEndpoint:      End point for connectiong to mrs proxy service without CAFE with tcp.
          MrsProxyClientMrsHttpsEndpoint: End point for connectiong to mrs proxy service without CAFE with https.
      --> 
      <endpoint 
          name="MrsProxyClientHttpsEndpoint" 
          address="https://RemoteHostName/EWS/mrsproxy.svc" 
          binding="customBinding"
          bindingConfiguration="MrsProxyClientHttpsBinding"
          contract="Microsoft.Exchange.MailboxReplicationService.IMailboxReplicationProxyService"
          behaviorConfiguration="MrsProxyEndpointBehavior"/>
      <endpoint
          name="MrsProxyClientMrsHttpsEndpoint"
          address="https://RemoteHostName/Microsoft.Exchange.MailboxReplicationService.ProxyService"
          binding="customBinding"
          bindingConfiguration="MrsProxyClientHttpsBinding"
          contract="Microsoft.Exchange.MailboxReplicationService.IMailboxReplicationProxyService"
          behaviorConfiguration="MrsProxyEndpointBehavior"/>
      <endpoint
          name="MrsProxyClientCertEndpoint"
          address="https://RemoteHostName/Microsoft.Exchange.MailboxReplicationService.ProxyService/Cert"
          binding="wsHttpBinding"
          bindingConfiguration="MrsCertBinding"
          contract="Microsoft.Exchange.MailboxReplicationService.IMailboxReplicationProxyService"
          behaviorConfiguration="MrsProxyEndpointBehavior"/>
      <endpoint 
          name="MrsProxyClientTcpEndpoint" 
          address="net.tcp://RemoteHostName/Microsoft.Exchange.MailboxReplicationService.ProxyService" 
          binding="netTcpBinding"
          bindingConfiguration="MrsProxyClientTcpBinding"
          contract="Microsoft.Exchange.MailboxReplicationService.IMailboxReplicationProxyService"
          behaviorConfiguration="MrsProxyEndpointBehavior"/>
    </client>

    <behaviors>
      <serviceBehaviors>
        <behavior name="MrsServiceBehavior">
          <serviceDebug includeExceptionDetailInFaults="True" />
          <serviceAuthorization serviceAuthorizationManagerType="Microsoft.Exchange.MailboxReplicationService.MRSAuthorizationManager, Microsoft.Exchange.MailboxReplicationService, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          <serviceThrottling
              maxConcurrentCalls="64"
              maxConcurrentSessions="64"
              maxConcurrentInstances="64" />
        </behavior>
        <behavior name="MrsProxyServiceBehavior">
          <serviceDebug includeExceptionDetailInFaults="True" />
          <serviceAuthorization serviceAuthorizationManagerType="Microsoft.Exchange.MailboxReplicationService.MRSProxyAuthorizationManager, Microsoft.Exchange.MailboxReplicationService.ProxyService, Version=15.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
          <serviceThrottling
              maxConcurrentCalls="200"
              maxConcurrentSessions="200"
              maxConcurrentInstances="200" />
          <dataContractSerializer maxItemsInObjectGraph="20000000"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="MrsProxyEndpointBehavior">
          <dataContractSerializer maxItemsInObjectGraph="2000000"/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <diagnostics performanceCounters="All" />
  </system.serviceModel>
  <!-- Mailbox Replication Service configuration 

    Setting Name - Default, MinValue, MaxValue
    
    MaxRetries - 60, 0, 1000
    MaxCleanupRetries - 480, 0, 600
    RetryDelay - 00:00:30, 00:00:10, 00:30:00
    MaxMoveHistoryLength - 5, 0, 100 
    MaxActiveMovesPerSourceMDB - 20, 0, 100
    MaxActiveMovesPerTargetMDB - 20, 0, 100
    MaxActiveMovesPerSourceServer - 100, 0, 1000
    MaxActiveMovesPerTargetServer - 100, 0, 1000
    MaxActiveJobsPerSourceMailbox - 5, 0, 100
    MaxActiveJobsPerTargetMailbox - 2, 0, 100
    MaxTotalRequestsPerMRS - 100, 0, 1024
    FullScanMoveJobsPollingPeriod - 00:15:00, 00:03:00, 1.00:00:00
    FullScanLightJobsPollingPeriod - 00:15:00, 00:00:30, 1.00:00:00
    ADInconsistencyCleanUpPeriod - 1.00:00:00, 00:00:00, 10.00:00:00 
    WLMResourceStatsLoggingPeriod - 00:30:00, 00:00:00, 10.00:00:00 
    WLMResourceStatsLogEnabled = false, false, true
    WLMResourceStatsLogMaxDirSize = 50000000, 0, 1048576000 (bytes)
    WLMResourceStatsLogMaxFileSize = 500000, 0, 10485760 (bytes)
    HeavyJobPickupPeriod - 00:00:05, 00:00:00, 10.00:00:00 
    LightJobPickupPeriod - 00:00:10, 00:00:00, 10.00:00:00 
    MinimumDatabaseScanInterval - 00:01:00, 00:00:00, 00:30:00
    BackoffIntervalForProxyConnectionLimitReached - 00:05:00, 00:00:30, 1.00:00:00
    DataGuaranteeCheckPeriod - 00:00:05, 00:00:01, 02:00:00
    DataGuaranteeTimeout = 00:10:00, 00:00:00, 12:00:00
    DataGuaranteeLogRollDelay = 00:01:00, 00:00:00, 12:00:00
    DataGuaranteeRetryInterval = 00:15:00, 00:00:00, 12:00:00
    DataGuaranteeMaxWait = 1.00:00:00, 00:00:00, 7.00:00:00
    DelayCheckPeriod = 00:00:05, 00:00:01, 00:01:00
    MailboxLockoutTimeout = 02:00:00, 00:00:00, 12:00:00
    MailboxLockoutRetryInterval = 00:05:00, 00:00:30, 12:00:00
    EnableDataGuaranteeCheck = true, false, true
    DisableMrsProxyBuffering = false, false, true
    WlmThrottlingJobTimeout = 00:05:00, 00:00:00, 12:00:00
    WlmThrottlingJobRetryInterval = 00:10:00, 00:00:00, 12:00:00
    MRSProxyLongOperationTimeout = 00:20:00, 00:01:00, 02:00:00
    ContentVerificationIgnoreFAI = false, false, true
    ContentVerificationIgnorableMsgClasses = "" (semicolon-separated list of wildcarded message classes)
    ContentVerificationMissingItemThreshold = 0, 0, MaxInt
    DisableContentVerification = false, false, true
    PoisonLimit = 5, 0, 100
    HardPoisonLimit = 20, 0, 100 (make sure that configured PoisonLimit < HardPoisonLimit)
    DisableDynamicThrottling = true, false, true
    UseExtendedAclInformation = true, false, true
    SkipWordBreaking = false, false, true
    FailureHistoryLength = 60, 0, 1000
    LongRunningJobRelinquishInterval= 04:00:00, 00:00:00, 7.00:00:00
    LoggingPath = "" (defaults to ExchangeDir\Logging)
    MaxLogAge = 30.00:00:00, 00:00:00, 99999.00:00:00
    ReservationExpirationInterval = 00:05:00, 00:01:00, 12:00:00
    RequestLogEnabled = false, false, true
    RequestLogMaxDirSize = 50000000, 0, 1048576000 (bytes)
    RequestLogMaxFileSize = 500000, 0, 10485760 (bytes)
    FailureLogEnabled = false, false, true
    FailureLogMaxDirSize = 50000000, 0, 1048576000 (bytes)
    FailureLogMaxFileSize = 500000, 0, 10485760 (bytes)
    BadItemLogEnabled = false, false, true
    BadItemLogMaxDirSize = 50000000, 0, 1048576000 (bytes)
    BadItemLogMaxFileSize = 500000, 0, 10485760 (bytes)
    SessionStatisticsLogEnabled = false, false, true
    SessionStatisticsLogMaxDirSize = 50000000, 0, 1048576000 (bytes)
    SessionStatisticsLogMaxFileSize = 500000, 0, 10485760 (bytes)
    MinBatchSize = 300, 1, 10000
    MinBatchSizeKB = 7168, 1, 131072
    ExportBufferSizeKB =  128, 1, 131072
    OldItemAge = 366.00:00:00, 1.00:00:00, 18250.00:00:00
    BadItemLimitOldNonContact = 10, 0, 2147483647
    BadItemLimitContact = 0, 0, 2147483647
    BadItemLimitDistributionList = 0, 0, 2147483647
    BadItemLimitDefault = 10, 0, 2147483647
    BadItemLimitInDumpster = 100, 0, 2147483647
    BadItemLimitCalendarRecurrenceCorruption = 4000, 0, 2147483647
    BadItemLimitStartGreaterThanEndCalendarCorruption = 400, 0, 2147483647
    BadItemLimitConflictEntryIdCorruption = 100, 0, 2147483647
    BadItemLimitRecipientCorruption = 0, 0, 2147483647
    BadItemLimitUnifiedMessagingReportRecipientCorruption = 0, 0, 2147483647
    BadItemLimitNonCanonicalAclCorruption = 3, 0, 2147483647
    BadItemLimitStringArrayCorruption = 10, 0, 2147483647
    BadItemLimitInvalidMultivalueElementCorruption = 0, 0, 2147483647
    BadItemLimitNonUnicodeValueCorruption = 0, 0, 2147483647
    SendGenericWatson = false, false, true
    MaxIncrementalChanges = 1000, 0, 50000
    CrawlerPageSize = 10, 1, 2147483647
    EnumerateMessagesPageSize = 500, 1, 2147483647
    MaxFolderOpened = 10, 1, 2147483647
    CrawlAndCopyFolderTimeout = 00:00:10 00:00:01 00:01:00
    CopyInferenceProperties = true, false, true
    DCNameValidityInterval = 02:00:00, 00:00:00, 7.00:00:00
    GetActionsPageSize = 1000, 0, 2147483647
    ReconnectAbandonInterval = 2.00:00:00, 00:00:00, 365.00:00:00
    IsEnabled = true, false, true
    IsJobPickupEnabled = true, false, true
    ActivatedJobIncrementalSyncInterval = 00:01:00, 00:00:05, 1.00:00:00
    DeactivateJobInterval = 00:17:00, 00:01:00, 1.00:00:00
    AllAggregationSyncJobsInteractive = false, false, true
    AllowRestoreFromConnectedMailbox = false, false, true
    StalledByHigherPriorityJobsTimeout = 00:10:00, 00:00:00, 12:00:00
    CanStoreCreatePFDumpster = true, false, true
    DisableContactSync = false, false, true
    CacheJobQueues = false, false, true
    QuarantineEnabled = false, false, true
    ServerBusyBackoffExpired - 01:00:00, 00:05:00, 1.00:00:00
  -->
  
  <MRSConfiguration
    MaxRetries="60"
    MaxCleanupRetries="480"
    MaxStallRetryPeriod="00:15:00"
    RetryDelay="00:00:30"
    MaxMoveHistoryLength="5"
    MaxActiveMovesPerSourceMDB="20"
    MaxActiveMovesPerTargetMDB="20"
    MaxActiveMovesPerSourceServer="100"
    MaxActiveMovesPerTargetServer="100"
    MaxActiveJobsPerSourceMailbox="5"
    MaxActiveJobsPerTargetMailbox="2"
    MaxTotalRequestsPerMRS="100"
    FullScanMoveJobsPollingPeriod="00:15:00"
    FullScanLightJobsPollingPeriod="00:15:00"
    ADInconsistencyCleanUpPeriod="1:00:00:00"
    WLMResourceStatsLoggingPeriod="00:30:00"
    WLMResourceStatsLogEnabled = "false"
    WLMResourceStatsLogMaxDirSize = "50000000"
    WLMResourceStatsLogMaxFileSize = "500000"
    HeavyJobPickupPeriod="00:00:05"
    LightJobPickupPeriod="00:00:10"
    MinimumDatabaseScanInterval="00:01:00"
    BackoffIntervalForProxyConnectionLimitReached = "00:05:00"
    DataGuaranteeCheckPeriod="00:00:05"
    DataGuaranteeTimeout="00:10:00"
    DataGuaranteeLogRollDelay="00:01:00"
    DataGuaranteeRetryInterval="00:15:00"
    DataGuaranteeMaxWait="1.00:00:00"
    DelayCheckPeriod="00:00:05"
    MailboxLockoutTimeout="02:00:00"
    MailboxLockoutRetryInterval="00:05:00"
    EnableDataGuaranteeCheck="true"
    DisableMrsProxyBuffering="false"
    WlmThrottlingJobTimeout="00:05:00"
    WlmThrottlingJobRetryInterval="00:10:00"
    MRSProxyLongOperationTimeout="00:20:00"
    ContentVerificationIgnoreFAI="false"
    ContentVerificationIgnorableMsgClasses=""
    ContentVerificationMissingItemThreshold="0"
    DisableContentVerification="false"
    PoisonLimit="5"
    HardPoisonLimit="20"
    DisableDynamicThrottling="true"
    UseExtendedAclInformation="true"
    SkipWordBreaking = "false"
    FailureHistoryLength="60"
    LongRunningJobRelinquishInterval="04:00:00"
    ReservationExpirationInterval="00:05:00"
    LoggingPath=""
    MaxLogAge="30.00:00:00"
    RequestLogEnabled="false"
    RequestLogMaxDirSize="50000000"
    RequestLogMaxFileSize="500000"
    FailureLogEnabled="false"
    FailureLogMaxDirSize="50000000"
    FailureLogMaxFileSize="500000"
    BadItemLogEnabled="false"
    BadItemLogMaxDirSize="50000000"
    BadItemLogMaxFileSize="500000"
    MinBatchSize="500"
    MinBatchSizeKB="7168"
    ExportBufferSizeKB="512"
    OldItemAge = "366.00:00:00"
    BadItemLimitOldNonContact = "10"
    BadItemLimitContact = "0"
    BadItemLimitDistributionList = "0"
    BadItemLimitDefault = "10"
    BadItemLimitInDumpster = "100"
    BadItemLimitCalendarRecurrenceCorruption = "4000"
    BadItemLimitStartGreaterThanEndCalendarCorruption = "400"
    BadItemLimitConflictEntryIdCorruption = "100"
    BadItemLimitRecipientCorruption = "0"
    BadItemLimitUnifiedMessagingReportRecipientCorruption = "0"
    BadItemLimitNonCanonicalAclCorruption = "3"
    BadItemLimitStringArrayCorruption = "10"
    BadItemLimitInvalidMultivalueElementCorruption = "0"
    BadItemLimitNonUnicodeValueCorruption = "0"
    SendGenericWatson = "false"
    MaxIncrementalChanges = "1000"
    CrawlerPageSize = "10"
    EnumerateMessagesPageSize = "500"
    MaxFolderOpened = "10"
    CrawlAndCopyFolderTimeout = "00:00:10"
    CopyInferenceProperties ="true"
    DCNameValidityInterval = "02:00:00"
    GetActionsPageSize = "1000"
    ReconnectAbandonInterval = "2.00:00:00"
    IsEnabled = "true"
    IsJobPickupEnabled = "true"
    ActivatedJobIncrementalSyncInterval = "00:01:00"
    DeactivateJobInterval = "00:17:00"
    AllAggregationSyncJobsInteractive = "false"
    AllowRestoreFromConnectedMailbox = "false"
    StalledByHigherPriorityJobsTimeout = "00:10:00"
    CanStoreCreatePFDumpster = "true"
    DisableContactSync = "false"
    CacheJobQueues = "false"
    QuarantineEnabled = "false"
    ServerBusyBackoffExpired = "01:00:00"
    ProxyClientCertificateSubject="CN=EXHV-1633"
   />

  <MrsProxyConfiguration
    MaxMRSConnections="100"
    DataImportTimeout="00:01:00" />
  
  <appSettings>
    <!-- Mdb latency health threshold values in msec.  Valid range is from 0-1000. -->
    <add key="MdbFairUnhealthyLatencyThreshold" value="20"/>
    <add key="MdbHealthyFairLatencyThreshold" value="10"/>
    <!-- Maximum delay that WLM returns under "Fair" database resource health in msec. Valid range is from 0-60000 -->
    <add key="MdbLatencyMaxDelay" value="60000"/>
    <add key="LogEnabled" value="true" />
    <add key="LogDirectoryPath" value="%ExchangeInstallDir%Logging\MailboxReplicationService\" />
    <add key="LogFileAgeInDays" value="30" />
    <add key="LogDirectorySizeLimit" value="100MB" />
    <add key="LogFileSizeLimit" value="10MB" />
    <add key="LogCacheSizeLimit" value="2MB" />
    <add key="LogFlushIntervalInSeconds" value="60" />
  </appSettings>
</configuration>
