Ejemplo n.º 1
0
        private void OnPromotedMessageHandler(StoreDriverEventSource source, StoreDriverDeliveryEventArgs args)
        {
            StoreDriverDeliveryEventArgsImpl storeDriverDeliveryEventArgsImpl = (StoreDriverDeliveryEventArgsImpl)args;

            if (MeetingSeriesMessageOrderingAgent.SeriesMessageOrderingEnabled(storeDriverDeliveryEventArgsImpl.MailboxOwner))
            {
                this.OrderMessages(storeDriverDeliveryEventArgsImpl);
            }
        }
Ejemplo n.º 2
0
        private bool TryParkThisMessage(StoreDriverDeliveryEventArgsImpl args, MeetingSeriesMessageOrderingAgent.SeriesHeadersData headersData)
        {
            Guid networkMessageId = args.MailItemDeliver.MbxTransportMailItem.NetworkMessageId;

            this.AddUnparkedHeader(args.MailItem.Message.MimeDocument.RootPart.Headers, networkMessageId);
            bool   encapsulationSucceeded = true;
            string text;
            bool   encapsulationSucceeded2;

            using (EmailMessage emailMessage = ModerationHelper.EncapsulateOriginalMessage(args.MailItemDeliver.MbxTransportMailItem, new List <MailRecipient>
            {
                args.MailRecipient
            }, args.MailRecipient.Email.ToString(), args.MailRecipient.Email.ToString(), MeetingSeriesMessageOrderingAgent.tracer, delegate(Exception param0)
            {
                encapsulationSucceeded = false;
            }, out text))
            {
                if (encapsulationSucceeded)
                {
                    MailboxSession mailboxSession = args.MailboxSession;
                    using (ParkedMeetingMessage parkedMeetingMessage = ParkedMeetingMessage.Create(mailboxSession))
                    {
                        if (parkedMeetingMessage != null)
                        {
                            string internetMessageId = args.MailItemDeliver.MbxTransportMailItem.InternetMessageId;
                            ItemConversion.ConvertAnyMimeToItem(parkedMeetingMessage, emailMessage.MimeDocument, new InboundConversionOptions(args.ADRecipientCache));
                            parkedMeetingMessage.ParkedCorrelationId          = ParkedMeetingMessage.GetCorrelationId(headersData.SeriesId, headersData.SeriesSequenceNumber);
                            parkedMeetingMessage[StoreObjectSchema.ItemClass] = "IPM.Parked.MeetingMessage";
                            parkedMeetingMessage.CleanGlobalObjectId          = headersData.InstanceGoid;
                            parkedMeetingMessage.OriginalMessageId            = internetMessageId;
                            int retentionPeriod = MeetingSeriesMessageOrderingAgent.GetRetentionPeriod(args.MailboxOwner);
                            PolicyTagHelper.SetRetentionProperties(parkedMeetingMessage, ExDateTime.UtcNow.AddDays((double)retentionPeriod), retentionPeriod);
                            parkedMeetingMessage.Save(SaveMode.NoConflictResolution);
                        }
                    }
                }
                encapsulationSucceeded2 = encapsulationSucceeded;
            }
            return(encapsulationSucceeded2);
        }
Ejemplo n.º 3
0
 private StoreObjectId GetCachedCalendarItemIdFromHeaders(StoreDriverDeliveryEventArgsImpl args)
 {
     if (MeetingSeriesMessageOrderingAgent.SeriesMessageOrderingEnabled(args.MailboxOwner))
     {
         TextHeader textHeader = args.MailItem.Message.MimeDocument.RootPart.Headers.FindFirst("X-MS-Exchange-Calendar-Series-Instance-Calendar-Item-Id") as TextHeader;
         if (textHeader != null && !string.IsNullOrEmpty(textHeader.Value))
         {
             try
             {
                 return(StoreObjectId.Deserialize(textHeader.Value));
             }
             catch (FormatException arg)
             {
                 MeetingMessageProcessingAgent.tracer.TraceWarning <string, string, FormatException>((long)this.GetHashCode(), "Error deserializing cached calender item id from headers. Message {0}, mailbox {1}, error: {2}", args.MessageItem.InternetMessageId, args.MailboxSession.MailboxOwnerLegacyDN, arg);
             }
             catch (CorruptDataException arg2)
             {
                 MeetingMessageProcessingAgent.tracer.TraceWarning <string, string, CorruptDataException>((long)this.GetHashCode(), "Error deserializing cached calender item id from headers. Message {0}, mailbox {1}, error: {2}", args.MessageItem.InternetMessageId, args.MailboxSession.MailboxOwnerLegacyDN, arg2);
             }
         }
     }
     return(null);
 }