コード例 #1
0
        // Token: 0x06001AB2 RID: 6834 RVA: 0x0006FFDC File Offset: 0x0006E1DC
        private bool ExpandContactChain(ADRecipientExpansion.ExpandableEntry contact, ADRecipientExpansion.HandleRecipientDelegate handleRecipient, ADRecipientExpansion.HandleFailureDelegate handleFailure, Stack <ADRecipientExpansion.ExpandableEntry> expansionStack)
        {
            ExTraceGlobals.ADExpansionTracer.TraceDebug((long)this.GetHashCode(), "Expanding possible contact chain for: {0}", new object[]
            {
                contact.Entry[ADObjectSchema.Id]
            });
            ADRawEntry adrawEntry = this.session.FindByProxyAddress((ProxyAddress)contact.Entry[ADRecipientSchema.ExternalEmailAddress], this.allProperties);

            if (handleRecipient != null)
            {
                ExpansionType    expansionType    = (adrawEntry == null) ? ExpansionType.None : ExpansionType.ContactChain;
                ExpansionControl expansionControl = ADRecipientExpansion.InvokeRecipientDelegate(handleRecipient, contact.Entry, expansionType, contact.Parent);
                if (expansionControl != ExpansionControl.Continue)
                {
                    return(expansionControl != ExpansionControl.Terminate);
                }
            }
            if (adrawEntry != null)
            {
                ExTraceGlobals.ADExpansionTracer.TraceDebug((long)this.GetHashCode(), "Found chained object: {0}", new object[]
                {
                    adrawEntry[ADObjectSchema.Id]
                });
                return(this.ProcessChild(adrawEntry, contact, handleRecipient, handleFailure, expansionStack));
            }
            ExTraceGlobals.ADExpansionTracer.TraceDebug((long)this.GetHashCode(), "No contact chain found");
            return(true);
        }
コード例 #2
0
        // Token: 0x06001AB3 RID: 6835 RVA: 0x000700C4 File Offset: 0x0006E2C4
        private bool ProcessChild(ADRawEntry child, ADRecipientExpansion.ExpandableEntry parent, ADRecipientExpansion.HandleRecipientDelegate handleRecipient, ADRecipientExpansion.HandleFailureDelegate handleFailure, Stack <ADRecipientExpansion.ExpandableEntry> expansionStack)
        {
            ExpansionFailure failure       = ExpansionFailure.NotMailEnabled;
            bool             flag          = false;
            ExpansionType    expansionType = ADRecipientExpansion.GetExpansionType(child);

            ExTraceGlobals.ADExpansionTracer.TraceDebug <object, string>((long)this.GetHashCode(), "Processing recipient {0} with expansion type {1}", child[ADObjectSchema.Id], ADRecipientExpansion.GetExpansionTypeString(expansionType));
            if (!this.ignoreMailEnabledCase && !this.IsMailEnabled(child))
            {
                failure = ExpansionFailure.NotMailEnabled;
                flag    = true;
            }
            if (!flag && !this.IsAuthorized(child))
            {
                failure = ExpansionFailure.NotAuthorized;
                flag    = true;
            }
            if (!flag && expansionType != ExpansionType.None && this.IsLoopDetected(child, parent))
            {
                failure = ExpansionFailure.LoopDetected;
                flag    = true;
            }
            if (flag)
            {
                return(ADRecipientExpansion.InvokeFailureDelegate(handleFailure, failure, child, expansionType, parent) != ExpansionControl.Terminate);
            }
            ExpansionControl expansionControl = ExpansionControl.Continue;

            if (expansionType != ExpansionType.ContactChain)
            {
                expansionControl = ADRecipientExpansion.InvokeRecipientDelegate(handleRecipient, child, expansionType, parent);
            }
            if (expansionControl == ExpansionControl.Terminate)
            {
                return(false);
            }
            if (expansionControl != ExpansionControl.Skip && expansionType != ExpansionType.None)
            {
                expansionStack.Push(new ADRecipientExpansion.ExpandableEntry(child, expansionType, parent));
                ExTraceGlobals.ADExpansionTracer.TraceDebug((long)this.GetHashCode(), "Recipient {0} pushed on the expansion stack", new object[]
                {
                    child[ADObjectSchema.Id]
                });
            }
            return(true);
        }
コード例 #3
0
        // Token: 0x06001AB1 RID: 6833 RVA: 0x0006FF18 File Offset: 0x0006E118
        private bool ExpandAlternateRecipient(ADRecipientExpansion.ExpandableEntry recipient, ADRecipientExpansion.HandleRecipientDelegate handleRecipient, ADRecipientExpansion.HandleFailureDelegate handleFailure, Stack <ADRecipientExpansion.ExpandableEntry> expansionStack)
        {
            ExTraceGlobals.ADExpansionTracer.TraceDebug((long)this.GetHashCode(), "Expanding alternate recipient for: {0}", new object[]
            {
                recipient.Entry[ADObjectSchema.Id]
            });
            ADRawEntry adrawEntry = this.session.ReadADRawEntry((ADObjectId)recipient.Entry[ADRecipientSchema.ForwardingAddress], this.allProperties);

            if (adrawEntry == null)
            {
                ExTraceGlobals.ADExpansionTracer.TraceError((long)this.GetHashCode(), "Alternate recipient {0} for recipient {1} not found", new object[]
                {
                    recipient.Entry[ADRecipientSchema.ForwardingAddress],
                    recipient.Entry[ADObjectSchema.Id]
                });
                return(ADRecipientExpansion.InvokeFailureDelegate(handleFailure, ExpansionFailure.AlternateRecipientNotFound, recipient));
            }
            return(this.ProcessChild(adrawEntry, recipient, handleRecipient, handleFailure, expansionStack));
        }
コード例 #4
0
        // Token: 0x06001AA8 RID: 6824 RVA: 0x0006FB70 File Offset: 0x0006DD70
        private static ExpansionControl InvokeRecipientDelegate(ADRecipientExpansion.HandleRecipientDelegate handleRecipient, ADRawEntry recipient, ExpansionType expansionType, ADRecipientExpansion.ExpandableEntry parent)
        {
            if (handleRecipient == null)
            {
                return(ExpansionControl.Continue);
            }
            ExpansionType expansionType2 = (parent == null) ? ExpansionType.None : parent.ExpansionType;

            ExTraceGlobals.ADExpansionTracer.TraceDebug(0L, "Invoking recipient delegate: recipient={0}; expansion-type={1}; parent={2}; parent-expansion-type={3}", new object[]
            {
                recipient[ADObjectSchema.Id],
                ADRecipientExpansion.GetExpansionTypeString(expansionType),
                (parent == null) ? "<null>" : parent.Entry[ADObjectSchema.Id],
                ADRecipientExpansion.GetExpansionTypeString(expansionType2)
            });
            ExpansionControl expansionControl = handleRecipient(recipient, expansionType, (parent == null) ? null : parent.Entry, expansionType2);

            ExTraceGlobals.ADExpansionTracer.TraceDebug <string>(0L, "Delegate returned '{0}'", ADRecipientExpansion.GetExpansionControlString(expansionControl));
            return(expansionControl);
        }
コード例 #5
0
        // Token: 0x06001AA5 RID: 6821 RVA: 0x0006FA48 File Offset: 0x0006DC48
        private static ExpansionType GetExpansionType(ADRawEntry entry)
        {
            RecipientType recipientType = (RecipientType)entry[ADRecipientSchema.RecipientType];

            switch (recipientType)
            {
            case RecipientType.Invalid:
            case RecipientType.PublicDatabase:
            case RecipientType.SystemAttendantMailbox:
            case RecipientType.SystemMailbox:
            case RecipientType.Computer:
                return(ExpansionType.None);

            case RecipientType.User:
            case RecipientType.UserMailbox:
            case RecipientType.MailUser:
                if (entry[ADRecipientSchema.ExternalEmailAddress] != null)
                {
                    return(ADRecipientExpansion.GetContactExpansionType(entry));
                }
                return(ADRecipientExpansion.GetAlternateRecipientType(entry));

            case RecipientType.Contact:
            case RecipientType.MailContact:
                return(ADRecipientExpansion.GetContactExpansionType(entry));

            case RecipientType.Group:
            case RecipientType.MailUniversalDistributionGroup:
            case RecipientType.MailUniversalSecurityGroup:
            case RecipientType.MailNonUniversalGroup:
            case RecipientType.DynamicDistributionGroup:
                return(ExpansionType.GroupMembership);

            case RecipientType.PublicFolder:
            case RecipientType.MicrosoftExchange:
                return(ADRecipientExpansion.GetAlternateRecipientType(entry));

            default:
                throw new InvalidOperationException("Unknown recipient type: " + recipientType);
            }
        }
コード例 #6
0
        // Token: 0x06001AB0 RID: 6832 RVA: 0x0006FDC8 File Offset: 0x0006DFC8
        private bool ExpandGroup(ADRecipientExpansion.ExpandableEntry group, ADRecipientExpansion.HandleRecipientDelegate handleRecipient, ADRecipientExpansion.HandleFailureDelegate handleFailure, Stack <ADRecipientExpansion.ExpandableEntry> expansionStack)
        {
            ExTraceGlobals.ADExpansionTracer.TraceDebug((long)this.GetHashCode(), "Expanding group: {0}", new object[]
            {
                group.Entry[ADObjectSchema.Id]
            });
            IADDistributionList iaddistributionList = this.session.FindByObjectGuid((Guid)group.Entry[ADObjectSchema.Guid]) as IADDistributionList;

            if (iaddistributionList == null)
            {
                ExTraceGlobals.ADExpansionTracer.TraceError((long)this.GetHashCode(), "Could not find group object by GUID {0}; treating the group as empty", new object[]
                {
                    group.Entry[ADObjectSchema.Guid]
                });
                return(ADRecipientExpansion.InvokeFailureDelegate(handleFailure, ExpansionFailure.NoMembers, group));
            }
            ADPagedReader <ADRawEntry> adpagedReader = iaddistributionList.Expand(1000, this.allProperties);
            bool flag = false;

            foreach (ADRawEntry child in adpagedReader)
            {
                flag = true;
                if (!this.ProcessChild(child, group, handleRecipient, handleFailure, expansionStack))
                {
                    return(false);
                }
            }
            if (!flag)
            {
                ExTraceGlobals.ADExpansionTracer.TraceDebug((long)this.GetHashCode(), "Expanded empty group: {0}", new object[]
                {
                    group.Entry[ADObjectSchema.Id]
                });
                return(ADRecipientExpansion.InvokeFailureDelegate(handleFailure, ExpansionFailure.NoMembers, group));
            }
            return(true);
        }
コード例 #7
0
 // Token: 0x06001AAD RID: 6829 RVA: 0x0006FCE2 File Offset: 0x0006DEE2
 private static bool InvokeFailureDelegate(ADRecipientExpansion.HandleFailureDelegate handleFailure, ExpansionFailure failure, ADRecipientExpansion.ExpandableEntry recipient)
 {
     return(ADRecipientExpansion.InvokeFailureDelegate(handleFailure, failure, recipient.Entry, recipient.ExpansionType, recipient.Parent) != ExpansionControl.Terminate);
 }