Ejemplo n.º 1
0
        // Token: 0x06000B34 RID: 2868 RVA: 0x00048374 File Offset: 0x00046574
        private static bool LogFailedToEnsureJunkEmailRule(Exception e, bool transient, MailboxSession session)
        {
            JunkEmailOptionsAssistant.Tracer.TraceError <ADObjectId, Exception>(0L, "Failed to ensure junk e-mail rule for mailbox {0}.  Exception: {1}", session.MailboxOwner.ObjectId, e);
            if (transient)
            {
                return(true);
            }
            if (e is ObjectNotFoundException)
            {
                return(false);
            }
            JunkEmailOptionsAssistant.EventLogger.LogEvent(InfoWorkerEventLogConstants.Tuple_FailedToEnsureJunkEmailRule, session.MailboxOwner.MailboxInfo.MailboxGuid.ToString(), new object[]
            {
                session.MailboxOwner.ObjectId,
                e
            });
            StoragePermanentException ex = e as StoragePermanentException;

            if (ex != null)
            {
                MapiExceptionFilter.ThrowInnerIfMapiExceptionHandledbyAI(ex);
                Exception innerException = ex.InnerException;
                if (innerException != null && innerException is NonUniqueRecipientException)
                {
                    return(false);
                }
            }
            return(true);
        }
        // Token: 0x06000B6A RID: 2922 RVA: 0x000497C4 File Offset: 0x000479C4
        public static void ThrowInnerIfMapiExceptionHandledbyAI(StoragePermanentException e)
        {
            if (e == null)
            {
                return;
            }
            MapiPermanentException ex = e.InnerException as MapiPermanentException;

            if (ex != null && MapiExceptionFilter.IsMapiPermanentExceptionHandledByAI(ex))
            {
                throw ex;
            }
        }
Ejemplo n.º 3
0
 private void RenderSubscriptionError(StoragePermanentException ex)
 {
     if (ex is InvalidExternalSharingSubscriberException)
     {
         this.RenderShareToExternalADDLResponse();
         return;
     }
     if (ex is InvalidSharingDataException || ex is InvalidExternalSharingInitiatorException)
     {
         this.RenderDataCorruptedResponse();
         return;
     }
     if (ex is InvalidSharingTargetRecipientException)
     {
         this.RenderArchiveNotSupportedResponse();
         return;
     }
     this.RenderNotFoundResponse();
 }
        private static MessageStatus GetMessageStatus(IMessageConverter converter, StoragePermanentException storageException)
        {
            StorageExceptionHandler.LogException(converter, storageException);
            ConversionFailedException ex = storageException as ConversionFailedException;

            if (ex != null)
            {
                return(StorageExceptionHandler.GetMessageStatus(converter, ex));
            }
            if (storageException is MailboxCrossSiteFailoverException || storageException is MailboxInfoStaleException)
            {
                return(new MessageStatus(converter.IsOutbound ? MessageAction.Skip : MessageAction.Reroute, StorageExceptionHandler.GetExceptionSmtpResponse(converter, storageException, true), storageException));
            }
            if (storageException is UnableToFindServerForDatabaseException || storageException is IllegalCrossServerConnectionException)
            {
                return(new MessageStatus(converter.IsOutbound ? MessageAction.Skip : MessageAction.RetryQueue, StorageExceptionHandler.GetExceptionSmtpResponse(converter, storageException, false), storageException));
            }
            if (storageException.InnerException is CannotGetSiteInfoException)
            {
                return(new MessageStatus(converter.IsOutbound ? MessageAction.RetryMailboxServer : MessageAction.RetryQueue, StorageExceptionHandler.GetExceptionSmtpResponse(converter, storageException.InnerException, true), storageException));
            }
            if (storageException.InnerException != null)
            {
                MapiPermanentException ex2 = storageException.InnerException as MapiPermanentException;
                if (ex2 != null)
                {
                    return(StorageExceptionHandler.GetMessageStatus <StoragePermanentException>(converter, ex2, storageException));
                }
                MapiRetryableException ex3 = storageException.InnerException as MapiRetryableException;
                if (ex3 != null)
                {
                    return(StorageExceptionHandler.GetMessageStatus <StoragePermanentException>(converter, ex3, storageException));
                }
            }
            return(new MessageStatus(MessageAction.NDR, StorageExceptionHandler.GetExceptionSmtpResponse(converter, storageException, true), storageException));
        }
        public override void PerformBatchOperation(object[][] batchedItemBuffer, int fetchedItemCount, StoreId currentFolderId, MailboxSession sourceMailbox, MailboxSession targetMailbox, Dictionary <StoreId, FolderNode> folderNodeMap, SearchResultProcessor processor)
        {
            processor.CheckTargetMailboxAvailableSpace();
            StoreId[] array = new StoreId[fetchedItemCount];
            for (int i = 0; i < fetchedItemCount; i++)
            {
                array[i] = (StoreId)batchedItemBuffer[i][0];
            }
            FolderNode folderNode = folderNodeMap[currentFolderId];

            using (Folder folder = Folder.Bind(sourceMailbox, currentFolderId))
            {
                processor.BackOffFromSourceStore();
                processor.BackOffFromTargetStore();
                try
                {
                    GroupOperationResult groupOperationResult = null;
                    lock (targetMailbox)
                    {
                        if (processor.IsAborted())
                        {
                            return;
                        }
                        if (folderNode.TargetFolderId == null)
                        {
                            this.CreateTargetFolder(targetMailbox, folderNode);
                        }
                        groupOperationResult = folder.CopyItems(targetMailbox, folderNode.TargetFolderId, false, array);
                    }
                    if (groupOperationResult.OperationResult != OperationResult.Succeeded)
                    {
                        SearchMailboxAction.Tracer.TraceError <OperationResult, LocalizedException>((long)this.GetHashCode(), "DeleteItems operation failed with operation result: {0} and exception: {1}", groupOperationResult.OperationResult, groupOperationResult.Exception);
                        if (groupOperationResult.Exception.GetType() == typeof(MapiExceptionPartialCompletion) || groupOperationResult.Exception.GetType() == typeof(PartialCompletionException))
                        {
                            StoragePermanentException e = new StoragePermanentException(Strings.CopyItemsFailed, groupOperationResult.Exception);
                            processor.ReportActionException(e);
                        }
                        else
                        {
                            SearchMailboxException e2 = new SearchMailboxException(Strings.CopyItemsFailed, groupOperationResult.Exception);
                            processor.ReportActionException(e2);
                        }
                    }
                    else
                    {
                        SearchMailboxAction.Tracer.TraceDebug <int, string>((long)this.GetHashCode(), "SearchMailboxWoker progressed with {0} message deletes on mailbox {1}", array.Length, processor.GetSourceUserName());
                    }
                }
                catch (ArgumentException ex)
                {
                    SearchMailboxAction.Tracer.TraceError <ArgumentException>((long)this.GetHashCode(), "CopyItems operation failed due to item validation failed, exception: {0}", ex);
                    SearchMailboxException e3 = new SearchMailboxException(Strings.CopyItemsFailed, ex);
                    processor.ReportActionException(e3);
                }
                catch (MapiExceptionPartialCompletion mapiExceptionPartialCompletion)
                {
                    SearchMailboxAction.Tracer.TraceError <MapiExceptionPartialCompletion>((long)this.GetHashCode(), "CopyItems operation failed due to insufficient space in target mailbox, exception: {0}", mapiExceptionPartialCompletion);
                    StoragePermanentException e4 = new StoragePermanentException(Strings.CopyItemsFailed, mapiExceptionPartialCompletion);
                    processor.ReportActionException(e4);
                }
                catch (PartialCompletionException ex2)
                {
                    SearchMailboxAction.Tracer.TraceError <PartialCompletionException>((long)this.GetHashCode(), "CopyItems operation failed due to insufficient space in target mailbox, exception: {0}", ex2);
                    StoragePermanentException e5 = new StoragePermanentException(Strings.CopyItemsFailed, ex2);
                    processor.ReportActionException(e5);
                }
            }
        }