Example #1
0
        protected override void ValidateWithDataObject(IConfigurable dataObject)
        {
            base.ValidateWithDataObject(dataObject);
            PopSubscriptionProxy    popSubscriptionProxy    = (PopSubscriptionProxy)dataObject;
            AuthenticationMechanism authenticationMechanism = base.Fields.IsModified("IncomingAuth") ? this.IncomingAuth : popSubscriptionProxy.IncomingAuthentication;
            SecureString            password = this.password ?? popSubscriptionProxy.Subscription.LogonPasswordSecured;
            string text = base.Fields.IsModified("IncomingUserName") ? base.IncomingUserName : popSubscriptionProxy.IncomingUserName;

            AggregationTaskUtils.ValidateUserName(text, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError));
            if (authenticationMechanism == AuthenticationMechanism.Basic)
            {
                AggregationTaskUtils.ValidateUnicodeInfoOnUserNameAndPassword(text, password, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError));
            }
            string text2 = base.Fields.IsModified("IncomingServer") ? base.IncomingServer : popSubscriptionProxy.IncomingServer;

            AggregationTaskUtils.ValidateIncomingServerLength(text2, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError));
            if (!base.ShouldSkipAccountValidation())
            {
                bool leaveOnServer          = base.Fields.IsModified("LeaveOnServer") ? this.LeaveOnServer : popSubscriptionProxy.LeaveOnServer;
                int  port                   = base.Fields.IsModified("IncomingPort") ? base.IncomingPort : popSubscriptionProxy.IncomingPort;
                SecurityMechanism  security = base.Fields.IsModified("IncomingSecurity") ? this.IncomingSecurity : popSubscriptionProxy.IncomingSecurity;
                LocalizedException exception;
                if (!Pop3AutoProvision.ValidatePopSettings(leaveOnServer, popSubscriptionProxy.AggregationType == AggregationType.Mirrored, text2, port, text, password, authenticationMechanism, security, popSubscriptionProxy.Subscription.UserLegacyDN, CommonLoggingHelper.SyncLogSession, out exception))
                {
                    base.WriteDebugInfoAndError(exception, (ErrorCategory)1003, dataObject);
                }
            }
        }
        protected override void ValidateWithDataObject(IConfigurable dataObject)
        {
            base.ValidateWithDataObject(dataObject);
            IMAPSubscriptionProxy imapsubscriptionProxy = dataObject as IMAPSubscriptionProxy;

            if (imapsubscriptionProxy == null)
            {
                throw new InvalidCastException("Expected dataObject of IMAPSubscriptionProxy type");
            }
            IMAPSubscriptionProxy imapsubscriptionProxy2 = IMAPSubscriptionProxy.ShallowCopy(imapsubscriptionProxy);

            if (base.Fields.IsModified("EmailAddress"))
            {
                imapsubscriptionProxy2.EmailAddress = base.EmailAddress;
            }
            if (base.Fields.IsModified("IncomingUserName"))
            {
                imapsubscriptionProxy2.IncomingUserName = base.IncomingUserName;
            }
            if (base.Fields.IsModified("IncomingServer"))
            {
                imapsubscriptionProxy2.IncomingServer = base.IncomingServer;
            }
            if (base.Fields.IsModified("IncomingPort"))
            {
                imapsubscriptionProxy2.IncomingPort = base.IncomingPort;
            }
            if (base.Fields.IsModified("IncomingAuth"))
            {
                imapsubscriptionProxy2.IncomingAuthentication = this.IncomingAuth;
            }
            if (base.Fields.IsModified("IncomingSecurity"))
            {
                imapsubscriptionProxy2.IncomingSecurity = this.IncomingSecurity;
            }
            AggregationTaskUtils.ValidateUserName(imapsubscriptionProxy2.IncomingUserName, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError));
            SecureString password = this.password ?? imapsubscriptionProxy.Subscription.LogonPasswordSecured;

            if (imapsubscriptionProxy2.IncomingAuthentication == IMAPAuthenticationMechanism.Basic)
            {
                AggregationTaskUtils.ValidateUnicodeInfoOnUserNameAndPassword(imapsubscriptionProxy2.IncomingUserName, password, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError));
            }
            AggregationTaskUtils.ValidateIncomingServerLength(imapsubscriptionProxy2.IncomingServer, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError));
            bool      skipAccountVerification = base.ShouldSkipAccountValidation();
            Exception ex = NewImapSubscription.ValidateSubscription(imapsubscriptionProxy2, password, skipAccountVerification);

            if (ex != null)
            {
                base.WriteDebugInfoAndError(ex, (ErrorCategory)1003, imapsubscriptionProxy2);
            }
        }
Example #3
0
        protected override void InternalBeginProcessing()
        {
            TaskLogger.LogEnter();
            base.InternalBeginProcessing();
            PopSubscriptionProxy dataObject = this.DataObject;

            if (dataObject.IncomingAuthentication == AuthenticationMechanism.Basic)
            {
                AggregationTaskUtils.ValidateUnicodeInfoOnUserNameAndPassword(dataObject.IncomingUserName, this.password, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError));
            }
            AggregationTaskUtils.ValidateIncomingServerLength(dataObject.IncomingServer, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError));
            base.WriteDebugInfo();
            TaskLogger.LogExit();
        }
        protected override void InternalBeginProcessing()
        {
            TaskLogger.LogEnter();
            base.InternalBeginProcessing();
            IMAPSubscriptionProxy dataObject = this.DataObject;

            if (dataObject.IncomingAuthentication == IMAPAuthenticationMechanism.Basic)
            {
                AggregationTaskUtils.ValidateUnicodeInfoOnUserNameAndPassword(dataObject.IncomingUserName, this.password, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError));
            }
            AggregationTaskUtils.ValidateIncomingServerLength(dataObject.IncomingServer, new Task.TaskErrorLoggingDelegate(base.WriteDebugInfoAndError));
            Exception ex = NewImapSubscription.ValidateSubscription(dataObject, this.password, this.Force);

            if (ex != null)
            {
                base.WriteDebugInfoAndError(ex, (ErrorCategory)1003, this.DataObject);
            }
            this.DataObject.SetPassword(this.password);
            base.WriteDebugInfo();
            TaskLogger.LogExit();
        }