예제 #1
0
        private string GenerateRecipientsTable(MeetingForwardNotification meetingForwardNotification)
        {
            StringBuilder stringBuilder = new StringBuilder();

            stringBuilder.Append("<table border=\"0\" cellpadding=\"2\"><tr><td width=\"29\">&nbsp;</td><td><b>" + Strings.descTahomaGreyMediumFontTag.ToString(this.CultureInfo) + Strings.descRecipientsLabel.ToString(this.CultureInfo) + "</font></b></td></tr>");
            List <Participant> participantCollection = meetingForwardNotification.GetParticipantCollection();

            foreach (Participant participant in participantCollection)
            {
                if (participant != null)
                {
                    MailboxSession session      = this.item.Item.Session as MailboxSession;
                    Participant    participant2 = Participant.TryConvertTo(participant, "SMTP", session);
                    if (participant2 == null)
                    {
                        participant2 = participant;
                    }
                    stringBuilder.Append("<tr><td width=\"29\">&nbsp;</td><td>");
                    stringBuilder.Append(Strings.descTahomaBlackMediumFontTag.ToString(this.CultureInfo));
                    stringBuilder.Append("<a href=\"mailto:");
                    stringBuilder.Append(participant2.EmailAddress);
                    stringBuilder.Append("\">");
                    stringBuilder.Append(participant2.DisplayName + "</a>&nbsp;");
                    stringBuilder.Append("</font></td></tr>");
                }
            }
            stringBuilder.Append("</table><br/>");
            return(stringBuilder.ToString());
        }
예제 #2
0
 private bool TryCreateMfnSubjectAndBody(MeetingForwardNotification meetingForwardNotification)
 {
     if (this.item.Sender != null)
     {
         ExTimeZone exTimeZoneFromItem = TimeZoneHelper.GetExTimeZoneFromItem(this.item.Item);
         string     value = string.Concat(new string[]
         {
             Strings.descTitle.ToString(this.CultureInfo),
             this.GenerateExplanation(),
             this.GenerateMeetingSubject(meetingForwardNotification),
             this.GenerateMeetingTime(meetingForwardNotification, exTimeZoneFromItem),
             this.GenerateRecipientsTable(meetingForwardNotification),
             this.GenerateTimeZoneInfo(exTimeZoneFromItem)
         });
         using (TextWriter textWriter = meetingForwardNotification.Body.OpenTextWriter(BodyFormat.TextHtml))
         {
             textWriter.Write(this.GenerateHeader());
             textWriter.Write(value);
             textWriter.Write(this.GenerateFooter());
         }
         meetingForwardNotification.Subject = string.Format(Strings.MeetingForwardNotificationSubject.ToString(this.CultureInfo), (meetingForwardNotification.Subject != null || meetingForwardNotification.Subject != string.Empty) ? meetingForwardNotification.Subject : Strings.NoSubject.ToString(this.CultureInfo));
         return(true);
     }
     return(false);
 }
예제 #3
0
 // Token: 0x0600079F RID: 1951 RVA: 0x000366F0 File Offset: 0x000348F0
 private void ProcessMeetingForwardNotification(MailboxSession itemStore, MeetingForwardNotification mfnMessage, ref CalendarItemBase originalCalItem, string internetMessageId)
 {
     try
     {
         if (!mfnMessage.CalendarProcessed)
         {
             if (!mfnMessage.TryUpdateCalendarItem(ref originalCalItem, false))
             {
                 throw new SkipException(Strings.descSkipExceptionFailedUpdateFromMfn);
             }
             ConflictResolutionResult conflictResolutionResult = originalCalItem.Save(SaveMode.ResolveConflicts);
             originalCalItem.Load();
             if (conflictResolutionResult.SaveStatus == SaveResult.IrresolvableConflict)
             {
                 throw new SaveConflictException(ServerStrings.ExSaveFailedBecauseOfConflicts(originalCalItem.Id), conflictResolutionResult);
             }
         }
         mfnMessage.SendRumUpdate(ref originalCalItem);
         originalCalItem.Load();
     }
     catch (ObjectNotFoundException innerException)
     {
         throw new TransientException(Strings.descTransientErrorInMfn, innerException);
     }
 }
예제 #4
0
        private string GenerateMeetingSubject(MeetingForwardNotification meetingForwardNotification)
        {
            StringBuilder stringBuilder = new StringBuilder();
            string        text          = meetingForwardNotification.Subject;

            if (text == null || text == string.Empty)
            {
                text = Strings.NoSubject.ToString(this.CultureInfo);
            }
            stringBuilder.Append("<table border=\"0\" cellpadding=\"2\"><tr><td width=\"29\">&nbsp;</td><td><b>" + Strings.descTahomaGreyMediumFontTag.ToString(this.CultureInfo) + Strings.descMeetingSubjectLabel.ToString(this.CultureInfo) + "</font></b></td></tr>");
            stringBuilder.Append("<tr><td width=\"29\">&nbsp;</td><td>");
            stringBuilder.Append(Strings.descTahomaBlackMediumFontTag.ToString(this.CultureInfo));
            stringBuilder.Append(text);
            stringBuilder.Append("</font></td></tr>");
            stringBuilder.Append("</table><br/>");
            return(stringBuilder.ToString());
        }
예제 #5
0
        private string GenerateMeetingTime(MeetingForwardNotification meetingForwardNotification, ExTimeZone tz)
        {
            StringBuilder stringBuilder = new StringBuilder();
            string        value         = meetingForwardNotification.GenerateWhen(this.CultureInfo, tz);

            if (string.IsNullOrEmpty(value))
            {
                value = Strings.NoStartTime.ToString(this.CultureInfo);
            }
            stringBuilder.Append("<table border=\"0\" cellpadding=\"2\"><tr><td width=\"29\">&nbsp;</td><td><b>" + Strings.descTahomaGreyMediumFontTag.ToString(this.CultureInfo) + Strings.descMeetingTimeLabel.ToString(this.CultureInfo) + "</font></b></td></tr>");
            stringBuilder.Append("<tr><td width=\"29\">&nbsp;</td><td>");
            stringBuilder.Append(Strings.descTahomaBlackMediumFontTag.ToString(this.CultureInfo));
            stringBuilder.Append(value);
            stringBuilder.Append("</font></td></tr>");
            stringBuilder.Append("</table><br/>");
            return(stringBuilder.ToString());
        }
예제 #6
0
        private void CopyMfnRecipientsTo(MeetingForwardNotification meetingForwardNotification, TransportMailItem mailItem)
        {
            bool resubmittedMessage = this.item.ResubmittedMessage;

            foreach (Recipient recipient in meetingForwardNotification.Recipients)
            {
                RoutingAddress address;
                int?           recipientType;
                if (SubmissionItemUtils.TryGetRoutingAddressFromParticipant(mailItem.ADRecipientCache, recipient.Participant, "Recipient", out address) && SubmissionItemUtils.GetP2RecipientType(resubmittedMessage, recipient, out recipientType))
                {
                    MailRecipient transportRecipient = mailItem.Recipients.Add((string)address);
                    string        refTypePropValue   = SubmissionItemBase.GetRefTypePropValue <string>(recipient, StoreObjectSchema.DisplayName);
                    SubmissionItemUtils.CopyRecipientPropsFromXSOToTransport(this.item, recipient, transportRecipient, recipientType, refTypePropValue);
                    MSExchangeStoreDriverSubmission.TotalRecipients.Increment();
                }
            }
        }
예제 #7
0
        private void CopyMfnContentTo(MeetingForwardNotification meetingForwardNotification, TransportMailItem mailItem)
        {
            OutboundConversionOptions outboundConversionOptions = new OutboundConversionOptions(Components.Configuration.FirstOrgAcceptedDomainTable.DefaultDomainName);

            outboundConversionOptions.DsnMdnOptions          = DsnMdnOptions.PropagateUserSettings;
            outboundConversionOptions.DsnHumanReadableWriter = Components.DsnGenerator.DsnHumanReadableWriter;
            outboundConversionOptions.RecipientCache         = mailItem.ADRecipientCache;
            outboundConversionOptions.UserADSession          = mailItem.ADRecipientCache.ADSession;
            mailItem.CacheTransportSettings();
            outboundConversionOptions.ClearCategories    = mailItem.TransportSettings.ClearCategories;
            outboundConversionOptions.UseRFC2231Encoding = mailItem.TransportSettings.Rfc2231EncodingEnabled;
            outboundConversionOptions.Limits.MimeLimits  = MimeLimits.Unlimited;
            outboundConversionOptions.AllowDlpHeadersToPenetrateFirewall = true;
            using (Stream stream = mailItem.OpenMimeWriteStream())
            {
                if (Components.Configuration.LocalServer.TransportServer.ContentConversionTracingEnabled && Components.Configuration.LocalServer.TransportServer.PipelineTracingPath != null)
                {
                    outboundConversionOptions.LogDirectoryPath = Components.Configuration.LocalServer.TransportServer.PipelineTracingPath.PathName;
                }
                ItemConversion.ConvertItemToSummaryTnef(meetingForwardNotification, stream, outboundConversionOptions);
            }
        }
예제 #8
0
 internal void CheckAndSubmitMfn(TransportMailItem originalMailItem)
 {
     if (!this.ShouldGenerateMfn())
     {
         return;
     }
     using (MeetingRequest meetingRequest = MeetingRequest.Bind(this.item.Session, this.item.Item.Id))
     {
         using (MeetingForwardNotification meetingForwardNotification = meetingRequest.CreateNotification())
         {
             TransportMailItem transportMailItem = TransportMailItem.NewSideEffectMailItem(originalMailItem, this.submitter.OrganizationId, LatencyComponent.Agent, MailDirectionality.Originating, this.submitter.ExternalOrganizationId);
             transportMailItem.From = RoutingAddress.NullReversePath;
             if (this.TryCreateMfnSubjectAndBody(meetingForwardNotification))
             {
                 Stream stream = transportMailItem.OpenMimeWriteStream();
                 stream.Close();
                 this.CopyMfnRecipientsTo(meetingForwardNotification, transportMailItem);
                 this.CopyMfnContentTo(meetingForwardNotification, transportMailItem);
                 MailboxSession mailboxSession = this.item.Item.Session as MailboxSession;
                 Participant    participant    = Participant.TryConvertTo(this.item.Sender, "SMTP", mailboxSession);
                 if (participant == null)
                 {
                     participant = this.item.Sender;
                 }
                 if (mailboxSession != null)
                 {
                     MfnLog.LogEntry(mailboxSession, string.Format("Decorating MFN with the address - Name {0}, EmailAddress : {1}, RoutingType : {2}", participant.DisplayName, participant.EmailAddress, participant.RoutingType));
                 }
                 Components.DsnGenerator.DecorateMfn(transportMailItem, participant.DisplayName, participant.EmailAddress);
                 this.item.DecorateMessage(transportMailItem);
                 this.item.ApplySecurityAttributesTo(transportMailItem);
                 ClassificationUtils.PromoteStoreClassifications(transportMailItem.RootPart.Headers);
                 this.submitter.StoreDriverSubmission.ThrowIfStopped();
                 transportMailItem.UpdateCachedHeaders();
                 this.submitter.SendMailItem(new SubmissionReadOnlyMailItem(transportMailItem, MailItemType.OtherMessage), null);
             }
         }
     }
 }