Ejemplo n.º 1
0
        private static EnhancedStatusCode TryParseMimeStatusCode(int?mimeStatusCode)
        {
            EnhancedStatusCode result;

            if (mimeStatusCode != null && EnhancedStatusCode.TryParse(DsnMdnUtil.MimeStatusCodeToString(mimeStatusCode.Value), out result))
            {
                return(result);
            }
            return(null);
        }
Ejemplo n.º 2
0
        internal static object CodeGetter(IPropertyBag propertyBag)
        {
            string             escapedName = ((ADObjectId)propertyBag[ADObjectSchema.Id]).Rdn.EscapedName;
            EnhancedStatusCode result;

            if (EnhancedStatusCode.TryParse(escapedName, out result))
            {
                return(result);
            }
            return(null);
        }
Ejemplo n.º 3
0
        internal static object QuotaMessageTypeGetter(IPropertyBag propertyBag)
        {
            string             escapedName = ((ADObjectId)propertyBag[ADObjectSchema.Id]).Rdn.EscapedName;
            EnhancedStatusCode enhancedStatusCode;

            if (EnhancedStatusCode.TryParse(escapedName, out enhancedStatusCode))
            {
                return(null);
            }
            try
            {
                return(Enum.Parse(typeof(QuotaMessageType), escapedName, true));
            }
            catch (ArgumentException)
            {
            }
            return(null);
        }
Ejemplo n.º 4
0
        public static void GetMapiDsnRecipientStatusCode(string statusString, out MapiDiagnosticCode diagCode, out NdrReasonCode reasonCode, out int statusCode)
        {
            diagCode   = MapiDiagnosticCode.NoDiagnostic;
            reasonCode = NdrReasonCode.TransferFailed;
            EnhancedStatusCode enhancedStatusCode;

            string[] array;
            int      num;
            int      num2;
            int      num3;

            if (!EnhancedStatusCode.TryParse(statusString, out enhancedStatusCode) || (array = statusString.Split(new char[]
            {
                '.'
            })).Length != 3 || !int.TryParse(array[0], out num) || !int.TryParse(array[1], out num2) || !int.TryParse(array[2], out num3))
            {
                StorageGlobals.ContextTraceError <string>(ExTraceGlobals.CcInboundMimeTracer, "DsnMdnUtil::GetMapiDsnRecipientStatusCode: incorrect status string, {0}", statusString);
                throw new ConversionFailedException(ConversionFailureReason.CorruptContent, null);
            }
            switch (num2)
            {
            case 1:
                switch (num3)
                {
                case 1:
                    diagCode   = MapiDiagnosticCode.MailRecipientUnknown;
                    reasonCode = NdrReasonCode.TransferImpossible;
                    goto IL_288;

                case 2:
                    diagCode = MapiDiagnosticCode.BadDestinationSystemAddress;
                    goto IL_288;

                case 3:
                    diagCode = MapiDiagnosticCode.MailAddressIncorrect;
                    goto IL_288;

                case 4:
                    diagCode = MapiDiagnosticCode.OrNameAmbiguous;
                    goto IL_288;

                case 6:
                    diagCode = MapiDiagnosticCode.MailRecipientMoved;
                    goto IL_288;
                }
                diagCode = MapiDiagnosticCode.OrNameUnrecognized;
                break;

            case 2:
                switch (num3)
                {
                case 1:
                    diagCode = MapiDiagnosticCode.MailRefused;
                    break;

                case 2:
                    diagCode = MapiDiagnosticCode.LengthConstraintViolatd;
                    break;

                case 3:
                    diagCode = MapiDiagnosticCode.LengthConstraintViolatd;
                    break;

                case 4:
                    diagCode = MapiDiagnosticCode.ExpansionFailed;
                    break;

                default:
                    diagCode = MapiDiagnosticCode.MailRefused;
                    break;
                }
                break;

            case 3:
                switch (num3)
                {
                case 1:
                    diagCode = MapiDiagnosticCode.MailRefused;
                    break;

                case 2:
                    break;

                case 3:
                    diagCode = MapiDiagnosticCode.CriticalFuncUnsupported;
                    break;

                case 4:
                    diagCode = MapiDiagnosticCode.LengthConstraintViolatd;
                    break;

                case 5:
                    diagCode = MapiDiagnosticCode.LoopDetected;
                    break;

                default:
                    diagCode = MapiDiagnosticCode.MailRefused;
                    break;
                }
                break;

            case 4:
                switch (num3)
                {
                case 0:
                case 4:
                    goto IL_288;

                case 3:
                    reasonCode = NdrReasonCode.DirectoryOperatnFailed;
                    goto IL_288;

                case 6:
                case 8:
                    diagCode = MapiDiagnosticCode.LoopDetected;
                    goto IL_288;

                case 7:
                    diagCode = MapiDiagnosticCode.MaximumTimeExpired;
                    goto IL_288;
                }
                diagCode = MapiDiagnosticCode.MtsCongested;
                break;

            case 5:
                switch (num3)
                {
                case 3:
                    diagCode = MapiDiagnosticCode.TooManyRecipients;
                    goto IL_288;

                case 4:
                    diagCode = MapiDiagnosticCode.ParametersInvalid;
                    goto IL_288;
                }
                diagCode = MapiDiagnosticCode.NoBilateralAgreement;
                break;

            case 6:
                switch (num3)
                {
                case 1:
                    diagCode = MapiDiagnosticCode.ContentTypeUnsupported;
                    break;

                case 2:
                    diagCode = MapiDiagnosticCode.ProhibitedToConvert;
                    break;

                case 3:
                    diagCode = MapiDiagnosticCode.ImpracticalToConvert;
                    break;

                case 4:
                    diagCode = MapiDiagnosticCode.MultipleInfoLosses;
                    break;

                case 5:
                    reasonCode = NdrReasonCode.ConversionNotPerformed;
                    break;

                default:
                    diagCode = MapiDiagnosticCode.ContentTypeUnsupported;
                    break;
                }
                break;

            case 7:
                switch (num3)
                {
                case 1:
                    diagCode = MapiDiagnosticCode.SubmissionProhibited;
                    break;

                case 2:
                    diagCode = MapiDiagnosticCode.ExpansionProhibited;
                    break;

                case 3:
                    diagCode = MapiDiagnosticCode.ReassignmentProhibited;
                    break;

                default:
                    diagCode = MapiDiagnosticCode.SecureMessagingError;
                    break;
                }
                break;
            }
IL_288:
            if (num2 < 0 || num2 > 9)
            {
                num2 = 0;
            }
            if (num3 < 0 || num3 > 9)
            {
                num3 = 0;
            }
            statusCode = num * 100 + num2 * 10 + num3;
        }