public static PFRuleEvaluationContext Create(StoreObjectId folderId, ProxyAddress recipientProxyAddress, ICoreItem message, long mimeSize, PublicFolderSession session)
        {
            PFRuleEvaluationContext result;

            using (DisposeGuard disposeGuard = default(DisposeGuard))
            {
                Folder folder = Folder.Bind(session, folderId, RuleEvaluationContextBase.AdditionalFolderProperties);
                disposeGuard.Add <Folder>(folder);
                PFMessageContext pfmessageContext = new PFMessageContext(folder, message, session, recipientProxyAddress ?? ProxyAddress.Parse(ProxyAddressPrefix.Smtp.PrimaryPrefix, session.MailboxPrincipal.MailboxInfo.PrimarySmtpAddress.ToString()), new ADRecipientCache <ADRawEntry>(PFRuleEvaluationContext.RecipientProperties, 0, session.MailboxPrincipal.MailboxInfo.OrganizationId), mimeSize);
                disposeGuard.Add <PFMessageContext>(pfmessageContext);
                pfmessageContext.traceFormatter      = new TraceFormatter(false);
                session.ProhibitFolderRuleEvaluation = true;
                disposeGuard.Success();
                result = pfmessageContext;
            }
            return(result);
        }
예제 #2
0
 public PFAttachmentContext(PFMessageContext messageContext, Attachment attachment) : base(messageContext)
 {
     this.attachment = attachment;
 }
예제 #3
0
 public PFRecipientContext(PFMessageContext messageContext, Recipient recipient) : base(messageContext)
 {
     this.recipient = recipient;
 }