// Token: 0x0600206D RID: 8301 RVA: 0x00078A6C File Offset: 0x00076C6C
        internal static bool AddOtherMailboxConfig(CallContext callContext, string displayName, string primarySMTPAddress)
        {
            if (string.IsNullOrWhiteSpace(primarySMTPAddress))
            {
                return(false);
            }
            UserContext userContext = UserContextManager.GetUserContext(callContext.HttpContext, callContext.EffectiveCaller, true);

            if (userContext.IsExplicitLogon)
            {
                throw new OwaInvalidRequestException("Cannot open other's folder in explict logon mode");
            }
            SmtpAddress       smtpAddress        = SmtpAddress.Parse(primarySMTPAddress);
            IRecipientSession adrecipientSession = CallContext.Current.ADRecipientSessionContext.GetADRecipientSession();
            ADRecipient       adrecipient        = adrecipientSession.FindByProxyAddress(ProxyAddress.Parse(smtpAddress.ToString()));

            if (string.Equals(userContext.ExchangePrincipal.LegacyDn, adrecipient.LegacyExchangeDN, StringComparison.OrdinalIgnoreCase))
            {
                throw new OwaInvalidOperationException("Cannot open own folder");
            }
            SimpleConfiguration <OtherMailboxConfigEntry> otherMailboxConfig = OwaOtherMailboxConfiguration.GetOtherMailboxConfig(CallContext.Current);

            if (OwaOtherMailboxConfiguration.FindOtherMailboxConfigEntry(otherMailboxConfig, primarySMTPAddress) == null)
            {
                OtherMailboxConfigEntry otherMailboxConfigEntry = new OtherMailboxConfigEntry();
                otherMailboxConfigEntry.DisplayName          = displayName;
                otherMailboxConfigEntry.PrincipalSMTPAddress = primarySMTPAddress;
                otherMailboxConfig.Entries.Add(otherMailboxConfigEntry);
                otherMailboxConfig.Save(CallContext.Current);
            }
            return(true);
        }
        // Token: 0x0600206F RID: 8303 RVA: 0x00078B94 File Offset: 0x00076D94
        internal static SimpleConfiguration <OtherMailboxConfigEntry> GetOtherMailboxConfig(CallContext callContext)
        {
            SimpleConfiguration <OtherMailboxConfigEntry> simpleConfiguration = new SimpleConfiguration <OtherMailboxConfigEntry>();

            simpleConfiguration.Load(callContext);
            OwaOtherMailboxConfiguration.ConvertLegacyItemIdFormatIfNecessary(simpleConfiguration, callContext);
            return(simpleConfiguration);
        }
        // Token: 0x0600206E RID: 8302 RVA: 0x00078B4C File Offset: 0x00076D4C
        internal static bool RemoveOtherMailboxConfig(CallContext callContext, string primarySMTPAddress)
        {
            if (string.IsNullOrWhiteSpace(primarySMTPAddress))
            {
                return(false);
            }
            SimpleConfiguration <OtherMailboxConfigEntry> otherMailboxConfig = OwaOtherMailboxConfiguration.GetOtherMailboxConfig(CallContext.Current);
            OtherMailboxConfigEntry otherMailboxConfigEntry = OwaOtherMailboxConfiguration.FindOtherMailboxConfigEntry(otherMailboxConfig, primarySMTPAddress);

            if (otherMailboxConfigEntry != null)
            {
                otherMailboxConfig.Entries.Remove(otherMailboxConfigEntry);
                otherMailboxConfig.Save(CallContext.Current);
            }
            return(true);
        }
        // Token: 0x06002070 RID: 8304 RVA: 0x00078BB8 File Offset: 0x00076DB8
        internal void LoadAll(CallContext callContext)
        {
            SimpleConfiguration <OtherMailboxConfigEntry> otherMailboxConfig = OwaOtherMailboxConfiguration.GetOtherMailboxConfig(callContext);

            this.PopulateConfigEntries(otherMailboxConfig.Entries);
        }
Example #5
0
 protected override bool InternalExecute()
 {
     return(OwaOtherMailboxConfiguration.RemoveOtherMailboxConfig(CallContext.Current, this.primarySMTPAddress));
 }