Ejemplo n.º 1
0
        private bool IsGeneratingReply()
        {
            Rule       rule        = this.workItem.Rule;
            int        actionIndex = this.workItem.ActionIndex;
            RuleAction ruleAction  = rule.Actions[actionIndex];

            RuleAction.Type actionType = ruleAction.ActionType;
            return(actionType == RuleAction.Type.OP_REPLY || actionType == RuleAction.Type.OP_OOF_REPLY || actionType == RuleAction.Type.OP_DELETE);
        }
Ejemplo n.º 2
0
 private void ValidateRecipientCollections(TransportMailItem mailItem, IList <string> invalidRecipients)
 {
     if (this.IsGeneratingReply())
     {
         return;
     }
     if ((invalidRecipients != null && invalidRecipients.Count > 0) || mailItem.Recipients.Count == 0)
     {
         Rule            rule        = this.workItem.Rule;
         RuleAction.Type actionType  = this.workItem.Rule.Actions[this.workItem.ActionIndex].ActionType;
         int             actionIndex = this.workItem.ActionIndex;
         this.context.MarkRuleInError(rule, actionType, actionIndex, DeferredError.RuleError.Execution);
     }
 }
Ejemplo n.º 3
0
 public override void MarkRuleInError(Rule rule, RuleAction.Type actionType, int actionIndex, DeferredError.RuleError errorCode)
 {
     base.MarkRuleInError(rule, actionType, actionIndex, errorCode);
     using (DeferredError deferredError = DeferredError.Create(base.StoreSession as MailboxSession, base.CurrentFolder.StoreObjectId, rule.Provider, rule.ID, actionType, actionIndex, errorCode))
     {
         byte[] array = deferredError.Save();
         if (array != null)
         {
             if (this.daeMessageEntryIds == null)
             {
                 this.daeMessageEntryIds = new List <byte[]>();
             }
             this.daeMessageEntryIds.Add(array);
         }
     }
 }
Ejemplo n.º 4
0
        public static DeferredError Create(MailboxSession session, StoreObjectId folderId, string providerName, long ruleId, RuleAction.Type actionType, int actionNumber, DeferredError.RuleError ruleError)
        {
            Util.ThrowOnNullArgument(session, "session");
            Util.ThrowOnNullArgument(folderId, "folderId");
            Util.ThrowOnNullArgument(providerName, "providerName");
            EnumValidator.ThrowIfInvalid <RuleAction.Type>(actionType, "actionType");
            EnumValidator.ThrowIfInvalid <DeferredError.RuleError>(ruleError, "ruleError");
            if (!IdConverter.IsFolderId(folderId))
            {
                throw new ArgumentException(ServerStrings.InvalidFolderId(folderId.ToBase64String()));
            }
            DeferredError deferredError = new DeferredError();

            deferredError.message = MessageItem.Create(session, session.GetDefaultFolderId(DefaultFolderType.DeferredActionFolder));
            deferredError.message[InternalSchema.ItemClass]         = "IPC.Microsoft Exchange 4.0.Deferred Error";
            deferredError.message[InternalSchema.RuleFolderEntryId] = folderId.ProviderLevelItemId;
            deferredError.message[InternalSchema.RuleId]            = ruleId;
            deferredError.message[InternalSchema.RuleActionType]    = (int)actionType;
            deferredError.message[InternalSchema.RuleActionNumber]  = actionNumber;
            deferredError.message[InternalSchema.RuleError]         = ruleError;
            deferredError.message[InternalSchema.RuleProvider]      = providerName;
            return(deferredError);
        }
 public virtual void MarkRuleInError(Rule rule, RuleAction.Type actionType, int actionIndex, DeferredError.RuleError errorCode)
 {
     RuleUtil.MarkRuleInError(rule, this.folder.MapiFolder);
 }
 public virtual void DisableAndMarkRuleInError(Rule rule, RuleAction.Type actionType, int actionIndex, DeferredError.RuleError errorCode)
 {
     this.TraceError <Rule, DeferredError.RuleError>("Rule {0} will be disabled due to error: {1}", rule, errorCode);
     RuleUtil.DisableRule(rule, this.folder.MapiFolder);
     this.MarkRuleInError(rule, actionType, actionIndex, errorCode);
 }
Ejemplo n.º 7
0
 public static DeferredError CreateDAE(MailboxSession session, StoreObjectId ruleFolderId, string providerName, long ruleId, RuleAction.Type actionType, int actionNumber, DeferredError.RuleError ruleError)
 {
     return(DeferredError.Create(session, ruleFolderId, providerName, ruleId, actionType, actionNumber, ruleError));
 }