コード例 #1
0
        private bool ValidateMail(DataTransferObjects.BusinessObjects.Mail mailItem, Guid requestId)
        {
            //Validate MailItem
            var validateMailHelper = new ValidateMailHelper();

            //Validate no script in bodytext
            validateMailHelper.ScriptTag(mailItem.Body.Text, requestId);
            //validate recipient
            return(validateMailHelper.Recipient(mailItem.Recipient.To, requestId, ConfigHelper.RegexValidationPersonNo, ConfigHelper.RegexValidationOrganizationNo));
        }
コード例 #2
0
        /// <summary>
        /// Validates Mail, not containing any script tag and that the recipient is a valid personnumber or organizationnumber.
        /// </summary>
        /// <param name="mailItem"></param>
        /// <param name="requestId"></param>
        /// <returns></returns>
        private bool validateMail(Mail mailItem, Guid requestId)
        {
            LogManager.LogTrace(string.Format("SE.GOV.MM.Integration.DeliveryMailbox.BusinessLayer.BusinessManager: incoming validateMail with RequestId: {0}", requestId));
            //Validate MailItem
            var validateMailHelper = new ValidateMailHelper();

            //Validate no script in bodytext
            validateMailHelper.ScriptTag(mailItem.Body.Text, requestId);
            //validate recipient
            var isOk = validateMailHelper.Recipient(mailItem.Recipient.To, requestId, ConfigHelper.RegexValidationPersonNo, ConfigHelper.RegexValidationOrganizationNo);

            LogManager.LogTrace(string.Format("SE.GOV.MM.Integration.DeliveryMailbox.BusinessLayer.BusinessManager: leaving validateMail with RequestId: {0}", requestId));
            return(isOk);
        }