示例#1
0
        // Token: 0x06000B47 RID: 2887 RVA: 0x000487EC File Offset: 0x000469EC
        protected override void InvokeInternal(InvokeArgs invokeArgs, List <KeyValuePair <string, object> > customDataToLog)
        {
            MailboxSession mailboxSession = invokeArgs.StoreSession as MailboxSession;

            if (mailboxSession == null)
            {
                JunkEmailOptionsCommiterAssistant.Tracer.TraceError((long)this.GetHashCode(), "invokeArgs.StoreSession has to be an MailboxSession; it cannot be be null or PublicFolderSession.");
                throw new ArgumentNullException("mailboxSession");
            }
            Guid mailboxGuid = mailboxSession.MailboxOwner.MailboxInfo.MailboxGuid;

            if (!mailboxSession.Capabilities.CanHaveJunkEmailRule)
            {
                JunkEmailOptionsCommiterAssistant.Tracer.TraceDebug <string, Guid>((long)this.GetHashCode(), "Skipping mailbox {0} (GUID: {1}) because it cannot have a junk e-mail rule.  Possibly an alternate mailbox.", mailboxSession.MailboxOwner.MailboxInfo.DisplayName, mailboxGuid);
                try
                {
                    MailboxTagging.TagFinishedProcessing(mailboxSession);
                }
                catch (StoragePermanentException arg)
                {
                    JunkEmailOptionsCommiterAssistant.Tracer.TraceError <string, Guid, StoragePermanentException>((long)this.GetHashCode(), "Failed at tagging mailbox {0} (GUID: {1}).  Exception: {2}", mailboxSession.MailboxOwner.MailboxInfo.DisplayName, mailboxSession.MailboxGuid, arg);
                }
                return;
            }
            try
            {
                JunkEmailOptionsCommiterAssistant.Tracer.TraceDebug <string, Guid>((long)this.GetHashCode(), "Updating safe/block lists of mailbox {0} (GUID: {1})", mailboxSession.MailboxOwner.MailboxInfo.DisplayName, mailboxGuid);
                this.UpdateSafeLists(mailboxSession);
                JunkEmailOptionsCommiterAssistant.Tracer.TraceDebug <string, Guid>((long)this.GetHashCode(), "Update of mailbox {0} (GUID: {1}) was successful", mailboxSession.MailboxOwner.MailboxInfo.DisplayName, mailboxGuid);
                try
                {
                    MailboxTagging.TagFinishedProcessing(mailboxSession);
                }
                catch (StoragePermanentException arg2)
                {
                    JunkEmailOptionsCommiterAssistant.Tracer.TraceError <string, Guid, StoragePermanentException>((long)this.GetHashCode(), "Failed at tagging mailbox {0} (GUID: {1}).  Exception: {2}", mailboxSession.MailboxOwner.MailboxInfo.DisplayName, mailboxSession.MailboxGuid, arg2);
                }
            }
            catch (TransientException exception)
            {
                this.HandleExceptionAtUpdatingSafeList(exception, true, mailboxSession);
            }
            catch (JunkEmailValidationException exception2)
            {
                this.HandleExceptionAtUpdatingSafeList(exception2, false, mailboxSession);
            }
            catch (DataSourceOperationException exception3)
            {
                this.HandleExceptionAtUpdatingSafeList(exception3, false, mailboxSession);
            }
            catch (StoragePermanentException exception4)
            {
                this.HandleExceptionAtUpdatingSafeList(exception4, false, mailboxSession);
            }
            catch (DataValidationException exception5)
            {
                this.HandleExceptionAtUpdatingSafeList(exception5, false, mailboxSession);
            }
        }
示例#2
0
 // Token: 0x06000B49 RID: 2889 RVA: 0x00048A0C File Offset: 0x00046C0C
 private void HandleExceptionAtUpdatingSafeList(Exception exception, bool transient, MailboxSession mailboxSession)
 {
     JunkEmailOptionsCommiterAssistant.Tracer.TraceError <string, Guid, Exception>((long)this.GetHashCode(), "Update of mailbox {0} (GUID: {1}) failed with an exception: {2}", mailboxSession.MailboxOwner.MailboxInfo.DisplayName, mailboxSession.MailboxGuid, exception);
     this.skippedMailboxes.Add(mailboxSession.MailboxOwner.MailboxInfo.DisplayName, mailboxSession.MailboxGuid);
     try
     {
         if (transient)
         {
             MailboxTagging.TagForRetry(mailboxSession);
         }
         else
         {
             MailboxTagging.TagFinishedProcessing(mailboxSession);
         }
     }
     catch (StoragePermanentException arg)
     {
         JunkEmailOptionsCommiterAssistant.Tracer.TraceError <string, Guid, StoragePermanentException>((long)this.GetHashCode(), "Failed at tagging mailbox {0} (GUID: {1}).  Exception: {2}", mailboxSession.MailboxOwner.MailboxInfo.DisplayName, mailboxSession.MailboxGuid, arg);
     }
     throw new SkipException(exception);
 }